private static String toDigest ( String input ) { md . reset ( ) ; try { md . update ( input . getBytes ( "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e ) { } String result = com . ibm . ws . common . internal . encoder . Base64Coder . base64EncodeToString ( md . digest ( ) ) ; //String result = Base64.getEncoder().encodeToString(md.digest()); // java8 only return result ; }
store as digests to save space