/** * Hashes bytes in an array. * @param data The bytes to hash. * @param seed The seed for the hash. * @return The 32 bit hash of the bytes in question. */ public static int hash(byte[] data, int seed) { return hash(ByteBuffer.wrap(data), seed); }
/** * Hashes bytes in part of an array. * @param data The data to hash. * @param offset Where to start munging. * @param length How many bytes to process. * @param seed The seed to start with. * @return The 32-bit hash of the data in question. */ public static int hash(byte[] data, int offset, int length, int seed) { return hash(ByteBuffer.wrap(data, offset, length), seed); }
public long hash(String key) { return hash(SafeEncoder.encode(key)); } }