Class Murmur3

java.lang.Object
org.drasyl.util.Murmur3

public final class Murmur3 extends Object
This class contains methods for MurmurHash3 generation.
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    murmur3_x86_32(byte[] data)
    Generates a MurmurHash3 x86 32-bit hash without seed.
    static int
    murmur3_x86_32(byte[] data, int seed)
    Generates a MurmurHash3 x86 32-bit hash.
    static byte[]
    murmur3_x86_32BytesLE(byte[] data)
    Generates a MurmurHash3 x86 32-bit hash without seed with Little Endian Byte Order.
    static byte[]
    murmur3_x86_32BytesLE(byte[] data, int seed)
    Generates a MurmurHash3 x86 32-bit hash with Little Endian Byte Order.
    static int
    murmur3_x86_32LE(byte[] data)
    Generates a MurmurHash3 x86 32-bit hash without seed with Little Endian Byte Order.
    static int
    murmur3_x86_32LE(byte[] data, int seed)
    Generates a MurmurHash3 x86 32-bit hash with Little Endian Byte Order.

    Methods inherited from class java.lang.Object

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

    • murmur3_x86_32

      public static int murmur3_x86_32(byte[] data)
      Generates a MurmurHash3 x86 32-bit hash without seed.
      Parameters:
      data - the input to hash
      Returns:
      the MurmurHash3 x86 32-bit hash
      Throws:
      NullPointerException - if data is null
    • murmur3_x86_32

      public static int murmur3_x86_32(byte[] data, int seed)
      Generates a MurmurHash3 x86 32-bit hash.

      This method is a Java port of the MurmurHash3_x86_32 function from Austin Appleby.

      Parameters:
      data - the input to hash
      seed - the initial seed value
      Returns:
      the MurmurHash3 x86 32-bit hash
      Throws:
      NullPointerException - if data is null
    • murmur3_x86_32LE

      public static int murmur3_x86_32LE(byte[] data, int seed)
      Generates a MurmurHash3 x86 32-bit hash with Little Endian Byte Order.
      Parameters:
      data - the input to hash
      seed - the initial seed value
      Returns:
      the MurmurHash3 x86 32-bit hash
      Throws:
      NullPointerException - if data is null
    • murmur3_x86_32LE

      public static int murmur3_x86_32LE(byte[] data)
      Generates a MurmurHash3 x86 32-bit hash without seed with Little Endian Byte Order.
      Parameters:
      data - the input to hash
      Returns:
      the MurmurHash3 x86 32-bit hash
      Throws:
      NullPointerException - if data is null
    • murmur3_x86_32BytesLE

      public static byte[] murmur3_x86_32BytesLE(byte[] data, int seed)
      Generates a MurmurHash3 x86 32-bit hash with Little Endian Byte Order.
      Parameters:
      data - the input to hash
      seed - the initial seed value
      Returns:
      the MurmurHash3 x86 32-bit hash
      Throws:
      NullPointerException - if data is null
    • murmur3_x86_32BytesLE

      public static byte[] murmur3_x86_32BytesLE(byte[] data)
      Generates a MurmurHash3 x86 32-bit hash without seed with Little Endian Byte Order.
      Parameters:
      data - the input to hash
      Returns:
      the MurmurHash3 x86 32-bit hash
      Throws:
      NullPointerException - if data is null