Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String decrypt(String str) {
- if (str == null || str.length() == 0) {
- throw new IllegalArgumentException("String to encript cannot be null or zero length");
- }
- digester.update(str.getBytes());
- byte[] hash = digester.digest();
- StringBuffer hexString = new StringBuffer();
- for (int i = 0; i < hash.length; i++) {
- if ((0xff & hash[i]) < 0x10) {
- hexString.append("0" + Integer.toHexString((0xFF & hash[i])));
- }
- else {
- hexString.append(Integer.toHexString(0xFF & hash[i]));
- }
- }
- return hexString.toString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement