List of utility methods to do SHA1
String | sha1hash(String key) shahash return hashWithAlgorithm(HASH_ALGORITHM_SHA1, key);
|
String | sha1Hash(String s) sha Hash if (s == null) { return null; final MessageDigest messageDigest; try { messageDigest = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException(e); ... |
String | sha1Hash(String source) sha Hash MessageDigest digest = MessageDigest.getInstance("SHA1"); digest.update(source.getBytes(), 0, source.length()); return String.format("%040X", new BigInteger(1, digest.digest())); |
String | sha1Hash(String text) Compute the SHA-1 hash of a string, and return it has a string of hexadecimal numbers. return bytesToHex(computeHash(text, HASH_SHA1));
|
String | sha1Hash(String toHash) sha Hash byte[] uniqueKey = toHash.getBytes(); byte[] hash = null; hash = MessageDigest.getInstance("SHA1").digest(uniqueKey); StringBuilder hashString = new StringBuilder(); for (int i = 0; i < hash.length; i++) { String hex = Integer.toHexString(hash[i]); if (hex.length() == 1) { hashString.append('0'); ... |
String | sha1Hash(String tohash) sha Hash byte[] b = tohash.getBytes("UTF-8"); MessageDigest sha1 = MessageDigest.getInstance("SHA"); b = sha1.digest(b); return byteToHex(b); |
String | sha1HashHex(String data) sha Hash Hex return sha1HashHex(data.getBytes());
|
int | sha1HashInt(String text) Compute the SHA-1 hash of a string, and return a truncated int-value of the hash. return truncateHashToInt(computeHash(text, HASH_SHA1));
|
String | sha1Hex(byte[] bytes) sha Hex return toHex(sha1(bytes));
|
String | sha1Hex(String data) sha Hex if (data == null) { throw new IllegalArgumentException("data must not be null"); byte[] bytes = digest("SHA1", data); return toHexString(bytes); |