List of utility methods to do Hash Calculate
String | getHashOf(String s) get Hash Of MessageDigest md = MessageDigest.getInstance("SHA-256"); s += "TTM"; md.update(s.getBytes()); return byteArrayToHexString(md.digest()); |
String | getHashString() get Hash String long hashLong; synchronized (hashGenerator) { hashLong = hashGenerator.nextLong() & 0x7FFFFFFFFFFFFFFFL; return Long.toHexString(hashLong); |
String | getHashString(byte[] data) get Hash String return stringFormat(getHash(data));
|
String | getHashString(String password, String salt) get Hash String return bin2hex(getHash(iterations, createPasswordKey(password, salt), hex2bin(salt)));
|
String | getHashWithSalt(String input, String algorithm, String salt) This method hashes a string according to the desired message digest algorithm. MessageDigest digest = MessageDigest.getInstance(algorithm); digest.reset(); digest.update(salt.getBytes("UTF-8")); byte[] bytes = digest.digest(input.getBytes("UTF-8")); for (int i = 0; i < ITER; i++) { digest.reset(); bytes = digest.digest(bytes); return new BigInteger(1, bytes).toString(16); |
int | hash() Optimized implementation of #hash(int[]) with 0 args. return 1;
|
int | hash(Boolean value) hash return value ? 1231 : 1237;
|
int | hash(boolean value, int seed) Alters the given seed with the hash code value computed from the given value. return seed * PRIME_NUMBER + (value ? 1231 : 1237);
|
int | hash(boolean[] array) hash if (array.length == 4) { if (!array[0] && !array[1] && !array[2] && !array[3]) { return 0; return ((array[0] ? 1 : 0) << 3) + ((array[1] ? 1 : 0) << 2) + ((array[2] ? 1 : 0) << 1) + (array[3] ? 1 : 0); int n = 0; ... |
int | hash(byte x) hash return x;
|