The following packages need to be imported:
import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.math.BigInteger;
public String createMD5Hash (String token) { String s = token; MessageDigest m; String returnstring = null; try { m = MessageDigest.getInstance("MD5"); m.update(s.getBytes(),0,s.length()); returnstring = new BigInteger(1,m.digest()).toString(16); System.out.println("MD5: "+ returnstring); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return returnstring; }
Wiki Login|Wiki Index|Update Profile|Un/Subscribe to Changes
USA ePay and the USA ePay logo are registered trademarks of GorCorp Inc. Copyright © 2008, GorCorp Inc., All Rights Reserved