/** * @param b bytes to hash * @return Runs {@link WritableComparator#hashBytes(byte[], int)} on the * passed in array. This method is what {@link org.apache.hadoop.io.Text} and * {@link ImmutableBytesWritable} use calculating hash code. */ public static int hashCode(final byte [] b) { return hashCode(b, b.length); }
/** * @param b bytes to hash * @return A hash of <code>b</code> as an Integer that can be used as key in * Maps. */ public static Integer mapKey(final byte [] b) { return hashCode(b); }
/** * @param b bytes to hash * @param length length to hash * @return A hash of <code>b</code> as an Integer that can be used as key in * Maps. */ public static Integer mapKey(final byte [] b, final int length) { return hashCode(b, length); }
/** * @param b bytes to hash * @return A hash of <code>b</code> as an Integer that can be used as key in * Maps. */ public static Integer mapKey(final byte [] b) { return hashCode(b); }
/** * @param b bytes to hash * @param length length to hash * @return A hash of <code>b</code> as an Integer that can be used as key in * Maps. */ public static Integer mapKey(final byte [] b, final int length) { return hashCode(b, length); }
/** * @param b bytes to hash * @return Runs {@link WritableComparator#hashBytes(byte[], int)} on the * passed in array. This method is what {@link org.apache.hadoop.io.Text} and * {@link ImmutableBytesWritable} use calculating hash code. */ public static int hashCode(final byte [] b) { return hashCode(b, b.length); }