Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String MD5( String str )
- {
- MessageDigest md;
- try
- {
- md = MessageDigest.getInstance( "MD5" );
- md.reset();
- md.update( str.getBytes( "UTF-8" ) );
- byte[] digest = md.digest();
- BigInteger bigInt = new BigInteger( 1, digest );
- String hashtext = bigInt.toString( 16 );
- return hashtext;
- } catch ( Exception e )
- {
- return null;
- }
- }
Add Comment
Please, Sign In to add comment