Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String toMd5(String str) {
- try {
- MessageDigest m = MessageDigest.getInstance("MD5");
- m.update(str.getBytes(), 0, str.length());
- BigInteger i = new BigInteger(1,m.digest());
- return String.format("%1$032x", i);
- } catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement