Guest User

Untitled

a guest
Jan 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. public String MD5( String str ) throws Exception
  2. {
  3.     MessageDigest md;
  4.  
  5.     md = MessageDigest.getInstance( "MD5" );
  6.     md.reset();
  7.     md.update( str.getBytes( "UTF-8" ) );
  8.     byte[] digest = md.digest();
  9.        
  10.     BigInteger bigInt = new BigInteger( 1, digest );
  11.     String hashtext = bigInt.toString( 16 );
  12.        
  13.     return hashtext;
  14. }
Add Comment
Please, Sign In to add comment