Class Murmur3

java.lang.Object
com.io7m.jmurmur.Murmur3

public final class Murmur3 extends Object

An implementation of the public domain Murmur3 hash function.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The default seed if one is not explicitly given.
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    hashInt(int x)
    Hash the given integer value using the default seed (@link DEFAULT_SEED).
    static int
    hashIntWithSeed(int x, int seed)
    Hash the given integer value using the given seed to randomize the results.
    static int
    hashLong(long x)
    Hash the given long value using the default seed (@link DEFAULT_SEED).
    static int
    hashLongWithSeed(long x, int seed)
    Hash the given long value using the given seed to randomize the results.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_SEED

      public static final int DEFAULT_SEED
      The default seed if one is not explicitly given. Just a large prime, no significance.
      See Also:
  • Method Details

    • hashInt

      public static int hashInt(int x)
      Hash the given integer value using the default seed (@link DEFAULT_SEED).
      Parameters:
      x - The integer value.
      Returns:
      A hash value.
    • hashIntWithSeed

      public static int hashIntWithSeed(int x, int seed)
      Hash the given integer value using the given seed to randomize the results.
      Parameters:
      x - The integer value.
      seed - The seed value.
      Returns:
      A hash value.
    • hashLong

      public static int hashLong(long x)
      Hash the given long value using the default seed (@link DEFAULT_SEED).
      Parameters:
      x - The long value.
      Returns:
      A hash value.
    • hashLongWithSeed

      public static int hashLongWithSeed(long x, int seed)
      Hash the given long value using the given seed to randomize the results.
      Parameters:
      x - The long value.
      seed - The seed value.
      Returns:
      A hash value.