Hash a byte[] and long seed.

@param data the input byte array.
@param seed A long valued seed.
@return The 128-bit hash as a long[2].
170428
public static long[] hashToLongs(final byte[] data, final long seed) {
    if ((data == null) || (data.length == 0)) {
      return null;
    }
    return hash(data, seed);
  }
549605
public static int getPodHash(String key)
  {
    byte []buffer = new byte[16];
    
    int sublen = Math.min(key.length(), 8);
    
    for (int i = 0; i < sublen; i++) {
      buffer[i] = (byte) key.charAt(i);
    }
    
    long hash = Murmur64.generate(Murmur64.SEED, key);
    
    BitsUtil.writeLong(buffer, 8, hash);
    
    return calculatePodHash(buffer, 0, 16);
  }
1042332
public static NKey fromSeed(char[] seed) {
        DecodedSeed decoded = decodeSeed(seed); // Should throw on bad seed

        if (decoded.bytes.length == ED25519_PRIVATE_KEYSIZE) {
            return new NKey(Type.fromPrefix(decoded.prefix), null, seed);
        } else {
            try {
                return createPair(Type.fromPrefix(decoded.prefix), decoded.bytes);
            } catch (Exception e) {
                throw new IllegalArgumentException("Bad seed value", e);
            }
        }
    }
788582
public static long hash(byte[] digest, int index) {
        long f = ((long) (digest[3 + index * 4] & 0xFF) << 24)
            | ((long) (digest[2 + index * 4] & 0xFF) << 16)
            | ((long) (digest[1 + index * 4] & 0xFF) << 8)
            | (digest[index * 4] & 0xFF);
        return f & 0xFFFFFFFFL;
    }
39532
public static long byteArrayToLongLE( byte[] data ) {
        if (data == null)
            return 0x0;
        long accum = 0;
        int shiftBy = 0;
        for( byte b : data ) {
            accum |= (long) (b & 0xff) << shiftBy;
            shiftBy += 8;
        }
        return accum;
    }
951069
private static byte[] sha256(byte[] data) {
		MessageDigest md = null;
		try {
			md = MessageDigest.getInstance(ALGORITHM_SHA256);
			md.reset();
			md.update(data);
			return md.digest();
		} catch (Exception e) {
			LogUtil.writeErrorLog("SHA256计算失败", e);
			return null;
		}
	}
1362419
public static long[] hash(final long[] in, final long seed) {
    if ((in == null) || (in.length == 0)) {
      return emptyOrNull(seed, new long[2]);
    }
    return hash(Memory.wrap(in), 0L, in.length << 3, seed, new long[2]);
  }
67462
def hash64(data: Any, seed: int = 0) -> int:
    
    # -------------------------------------------------------------------------
    # MurmurHash3
    # -------------------------------------------------------------------------
    c_data = to_str(data)
    if mmh3:
        c_signed_low, _ = mmh3.hash64(data, seed=seed, x64arch=IS_64_BIT)
        return c_signed_low
    py_data = to_bytes(c_data)
    py_signed_low, _ = pymmh3_hash64(py_data, seed=seed)
    return py_signed_low
62835
public static int hashBytes(MemorySegment segment, int offset, int lengthInBytes) {
		return hashBytes(segment, offset, lengthInBytes, DEFAULT_SEED);
	}
124205
public static String shaBase64(final String salt, final String data) {
        return shaBase64(salt, data, null);
    }
497814
public byte[] hash(byte[] data) throws SdkClientException {
        try {
            MessageDigest md =  getMessageDigestInstance();
            md.update(data);
            return md.digest();
        } catch (Exception e) {
            throw new SdkClientException(
                    "Unable to compute hash while signing request: "
                            + e.getMessage(), e);
        }
    }
852322
public static MD5Hash digest(byte[] data, int start, int len) {
    byte[] digest;
    MessageDigest digester = DIGESTER_FACTORY.get();
    digester.update(data, start, len);
    digest = digester.digest();
    return new MD5Hash(digest);
  }
607805
public static int hashUnsafeBytesByWords(Object base, long offset, int lengthInBytes) {
		return hashUnsafeBytesByWords(base, offset, lengthInBytes, DEFAULT_SEED);
	}
803004
public static long murmurhash3(CharSequence chars, int seed) {

		final int len = chars.length();

		final int nblocks = len / 8;

		long h1 = seed;
		long h2 = seed;

		final long c1 = 0x87c37b91114253d5L;
		final long c2 = 0x4cf5ad432745937fL;

		for (int i = 0; i < nblocks; ++i) {
			int i0 = (i*2 + 0) * 4;
			int i1 = (i*2 + 1) * 4;

			long k1 = (long)chars.charAt(i0)
				     | (long)chars.charAt(i0+1) << 16
				     | (long)chars.charAt(i0+2) << 32
				     | (long)chars.charAt(i0+3) << 48;
			long k2 = (long)chars.charAt(i1)
				     | (long)chars.charAt(i1+1) << 16
				     | (long)chars.charAt(i1+2) << 32
				     | (long)chars.charAt(i1+3) << 48;

			k1 *= c1; k1 = k1 << 31 | k1 >>> (64-31); k1 *= c2; h1 ^= k1;

			h1 = h1 << 27 | h1 >>> (64-27); h1 += h2; h1 = h1*5 + 0x52dce729;

			k2 *= c2; k2 = k2 << 33 | k2 >>> (64-33); k2 *= c1; h2 ^= k2;

			h2 = h2 << 31 | h1 >>> (64-31); h2 += h1; h2 = h2*5 + 0x38495ab5;
		}

		long k1 = 0;
		long k2 = 0;

		switch (len & 7) {
			case  7: k2 ^= (long)chars.charAt(6) << 32;
			case  6: k2 ^= (long)chars.charAt(5) << 16;
			case  5: k2 ^= (long)chars.charAt(4) << 0;
						k2 *= c2; k2 = k2 << 33 | k2 >>> (64-33); k2 *= c1; h2 ^= k2;

			case  4: k1 ^= (long)chars.charAt(3) << 48;
			case  3: k1 ^= (long)chars.charAt(2) << 32;
			case  2: k1 ^= (long)chars.charAt(1) << 16;
			case  1: k1 ^= (long)chars.charAt(0) << 0;
						k1 *= c1; k1 = k1 << 31 | k1 >>> (64-31); k1 *= c2; h1 ^= k1;
			case  0: break;
		}

		h1 ^= len; h2 ^= len;

		h1 += h2;
		h2 += h1;

		h1 = fmix(h1);
		h2 = fmix(h2);

		h1 += h2;
		// h2 += h1;

		return h1;
	}
1292417
public void update(final int[] data) {
    if ((data == null) || (data.length == 0)) { return; }
    final long[] arr = hash(data, seed);
    hashUpdate(arr[0], arr[1]);
  }
1120344
public static int hash(int input)
    {
        int k1 = mixK1(input);
        int h1 = mixH1(DEFAULT_SEED, k1);

        return fmix(h1, SizeOf.SIZE_OF_INT);
    }
876155
public static int hashUnsafeBytes(Object base, long offset, int lengthInBytes) {
		return hashUnsafeBytes(base, offset, lengthInBytes, DEFAULT_SEED);
	}