Created
October 10, 2015 03:26
-
-
Save erichsu/a7f4a34acf92924db2dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String md5(String input) { | |
String md5 = null; | |
try { | |
MessageDigest digest = MessageDigest.getInstance("MD5"); | |
digest.update(input.getBytes(), 0, input.length()); | |
md5 = new BigInteger(1, digest.digest()).toString(16); | |
} catch (NoSuchAlgorithmException e) { | |
Timber.e(e.getLocalizedMessage(), e); | |
} | |
return md5; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment