Android Utililty Methods Byte Array Hash

List of utility methods to do Byte Array Hash

Description

The list of methods to do Byte Array Hash are organized into topic(s).

Method

inthashCode(byte[] data)
hash Code
if (data == null) {
    return 0;
int i = data.length;
int hc = i + 1;
while (--i >= 0) {
    hc *= 257;
    hc ^= data[i];
...
byte[]hash(String algorithm, byte[] data)
returns a hash SHA-1 of the given byte array
try {
    MessageDigest digest = MessageDigest.getInstance(algorithm);
    return digest.digest(data);
} catch (NoSuchAlgorithmException e) {
    return null;
intgetByteArrayHash(byte[] value)
Calculate the hash code of the given byte array.
int len = value.length;
int h = len;
if (len < 50) {
    for (int i = 0; i < len; i++) {
        h = 31 * h + value[i];
} else {
    int step = len / 16;
...