List of utility methods to do SHA1
String | sha1ToHex(String input, String encoding) sha To Hex byte[] digestResult = digest(input, "sha-1", encoding); return encodeHexString(digestResult); |
String | sha1Utf8(String clearText) sha Utf StringBuilder sb = new StringBuilder(); try { MessageDigest md = MessageDigest.getInstance("SHA-1"); md.update(clearText.getBytes(Charset.forName("UTF-8"))); byte[] md5 = md.digest(); for (byte b : md5) { int i = (b & 0xff); if (i < 16) ... |