Module hash4j

Class Hashing

java.lang.Object
com.dynatrace.hash4j.hashing.Hashing

public final class Hashing extends Object
Various implementations of hash functions.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Hasher64
    Returns a Hasher64 implementing the 64-bit FarmHashNa algorithm with default seed.
    static Hasher64
    farmHashNa(long seed)
    Returns a Hasher64 implementing the 64-bit FarmHashNa algorithm using the given seed value.
    static Hasher64
    farmHashNa(long seed0, long seed1)
    Returns a Hasher64 implementing the 64-bit FarmHashNa algorithm using the given seed values.
    static Hasher64
    Returns a Hasher64 implementing the 64-bit FarmHashUo algorithm with default seed.
    static Hasher64
    farmHashUo(long seed)
    Returns a Hasher64 implementing the 64-bit FarmHashUo algorithm using the given seed value.
    static Hasher64
    farmHashUo(long seed0, long seed1)
    Returns a Hasher64 implementing the 64-bit FarmHashUo algorithm using the given seed values.
    static Hasher64
    Returns a Hasher64 implementing the 64-bit Komihash (version 4.3) algorithm using a seed value of zero.
    static Hasher64
    komihash4_3(long seed)
    Returns a Hasher64 implementing the 64-bit Komihash (version 4.3) algorithm using the given seed value.
    static Hasher64
    Returns a Hasher64 implementing the 64-bit Komihash (version 5.0) algorithm using a seed value of zero.
    static Hasher64
    komihash5_0(long seed)
    Returns a Hasher64 implementing the 64-bit Komihash (version 5.0) algorithm using the given seed value.
    static Hasher128
    Returns a Hasher128 implementing the 128-bit Murmur3 algorithm (little-endian) using a seed value of zero.
    static Hasher128
    murmur3_128(int seed)
    Returns a Hasher128 implementing the 128-bit Murmur3 algorithm (little-endian) using the given seed value.
    static Hasher32
    Returns a Hasher32 implementing the 32-bit Murmur3 algorithm (little-endian) using a seed value of zero.
    static Hasher32
    murmur3_32(int seed)
    Returns a Hasher32 implementing the 32-bit Murmur3 algorithm (little-endian) using the given seed value.
    static Hasher64
    polymurHash2_0(long tweak, long seed)
    Returns a Hasher64 implementing the 64-bit PolymurHash (version 2.0) algorithm using the given tweak and seed value.
    static Hasher64
    polymurHash2_0(long tweak, long kSeed, long sSeed)
    Returns a Hasher64 implementing the 64-bit PolymurHash (version 2.0) algorithm using the given tweak and seed values.
    static Hasher64
    Returns a Hasher64 implementing the 64-bit RapidHash v3 algorithm using a seed value of zero and the default secret.
    static Hasher64
    rapidhash3(long seed)
    Returns a Hasher64 implementing the 64-bit RapidHash v3 algorithm using the given seed value and the default secret.
    static Hasher64
    Returns a Hasher64 implementing the 64-bit Wyhash (version final 3) algorithm using a seed value of zero and the default secret.
    static Hasher64
    wyhashFinal3(long seed)
    Returns a Hasher64 implementing the 64-bit Wyhash (version final 3) algorithm using the given seed value and the default secret.
    static Hasher64
    wyhashFinal3(long seed, long seedForSecret)
    Returns a Hasher64 implementing the 64-bit Wyhash (version final 3) algorithm using the given seed values.
    static Hasher64
    Returns a Hasher64 implementing the 64-bit Wyhash (version final 4) algorithm using a seed value of zero and the default secret.
    static Hasher64
    wyhashFinal4(long seed)
    Returns a Hasher64 implementing the 64-bit Wyhash (version final 4) algorithm using the given seed value and the default secret.
    static Hasher64
    wyhashFinal4(long seed, long seedForSecret)
    Returns a Hasher64 implementing the 64-bit Wyhash (version final 4) algorithm using the given seed values.
    static Hasher128
    Returns a Hasher128 implementing the 128-bit XXH3 algorithm.
    static Hasher128
    xxh3_128(long seed)
    Returns a Hasher128 implementing the 128-bit XXH3 algorithm using the given seed value.
    static Hasher64
    Returns a Hasher64 implementing the 64-bit XXH3 algorithm.
    static Hasher64
    xxh3_64(long seed)
    Returns a Hasher64 implementing the 64-bit XXH3 algorithm using the given seed value.

    Methods inherited from class java.lang.Object

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

    • murmur3_32

      public static Hasher32 murmur3_32()
      Returns a Hasher32 implementing the 32-bit Murmur3 algorithm (little-endian) using a seed value of zero.

      This implementation is compatible with the C++ reference implementation of MurmurHash3_x86_32 defined in MurmurHash3.cpp on an Intel x86 architecture.

      Returns:
      a hasher instance
    • murmur3_32

      public static Hasher32 murmur3_32(int seed)
      Returns a Hasher32 implementing the 32-bit Murmur3 algorithm (little-endian) using the given seed value.

      This implementation is compatible with the C++ reference implementation of MurmurHash3_x86_32 defined in MurmurHash3.cpp on an Intel x86 architecture.

      Parameters:
      seed - a 32-bit seed
      Returns:
      a hasher instance
    • murmur3_128

      public static Hasher128 murmur3_128()
      Returns a Hasher128 implementing the 128-bit Murmur3 algorithm (little-endian) using a seed value of zero.

      This implementation is compatible with the C++ reference implementation of MurmurHash3_x64_128 defined in MurmurHash3.cpp on an Intel x86 architecture.

      Returns:
      a hasher instance
    • murmur3_128

      public static Hasher128 murmur3_128(int seed)
      Returns a Hasher128 implementing the 128-bit Murmur3 algorithm (little-endian) using the given seed value.

      This implementation is compatible with the C++ reference implementation of MurmurHash3_x64_128 defined in MurmurHash3.cpp on an Intel x86 architecture.

      Parameters:
      seed - a 32-bit seed
      Returns:
      a hasher instance
    • komihash4_3

      public static Hasher64 komihash4_3()
      Returns a Hasher64 implementing the 64-bit Komihash (version 4.3) algorithm using a seed value of zero.

      This implementation is compatible with the C++ reference implementation of komihash defined in komihash.h on an Intel x86 architecture. Furthermore, it is compatible with Komihash versions 4.5 and 4.7.

      Returns:
      a hasher instance
    • komihash4_3

      public static Hasher64 komihash4_3(long seed)
      Returns a Hasher64 implementing the 64-bit Komihash (version 4.3) algorithm using the given seed value.

      This implementation is compatible with the C++ reference implementation of komihash defined in komihash.h on an Intel x86 architecture. Furthermore, it is compatible with Komihash versions 4.5 and 4.7.

      This implementation is also compatible with Komihash versions 4.5 and 4.7.

      Parameters:
      seed - a 64-bit seed
      Returns:
      a hasher instance
    • komihash5_0

      public static Hasher64 komihash5_0()
      Returns a Hasher64 implementing the 64-bit Komihash (version 5.0) algorithm using a seed value of zero.

      This implementation is compatible with the C++ reference implementation of komihash defined in komihash.h on an Intel x86 architecture.

      This implementation is also compatible with Komihash versions 5.1 and 5.7

      Returns:
      a hasher instance
    • komihash5_0

      public static Hasher64 komihash5_0(long seed)
      Returns a Hasher64 implementing the 64-bit Komihash (version 5.0) algorithm using the given seed value.

      This implementation is compatible with the C++ reference implementation of komihash defined in komihash.h on an Intel x86 architecture.

      This implementation is also compatible with Komihash versions 5.1 and 5.7

      Parameters:
      seed - a 64-bit seed
      Returns:
      a hasher instance
    • polymurHash2_0

      public static Hasher64 polymurHash2_0(long tweak, long seed)
      Returns a Hasher64 implementing the 64-bit PolymurHash (version 2.0) algorithm using the given tweak and seed value.

      This implementation is compatible with the C++ reference implementation of polymur_hash defined in polymur-hash.h on an Intel x86 architecture.

      Parameters:
      tweak - a 64-bit tweak
      seed - a 64-bit seed
      Returns:
      a hasher instance
    • polymurHash2_0

      public static Hasher64 polymurHash2_0(long tweak, long kSeed, long sSeed)
      Returns a Hasher64 implementing the 64-bit PolymurHash (version 2.0) algorithm using the given tweak and seed values.

      This implementation is compatible with the C++ reference implementation of polymur_hash defined in polymur-hash.h on an Intel x86 architecture.

      Parameters:
      tweak - a 64-bit tweak
      kSeed - a 64-bit kSeed
      sSeed - a 64-bit kSeed
      Returns:
      a hasher instance
    • wyhashFinal3

      public static Hasher64 wyhashFinal3()
      Returns a Hasher64 implementing the 64-bit Wyhash (version final 3) algorithm using a seed value of zero and the default secret.

      This implementation is compatible with the C++ reference implementation of wyhash defined in wyhash.h on an Intel x86 architecture.

      This implementation is also compatible with Komihash versions 4.5 and 4.7.

      Returns:
      a hasher instance
    • wyhashFinal3

      public static Hasher64 wyhashFinal3(long seed)
      Returns a Hasher64 implementing the 64-bit Wyhash (version final 3) algorithm using the given seed value and the default secret.

      This implementation is compatible with the C++ reference implementation of wyhash defined in wyhash.h on an Intel x86 architecture.

      Parameters:
      seed - a 64-bit seed
      Returns:
      a hasher instance
    • wyhashFinal3

      public static Hasher64 wyhashFinal3(long seed, long seedForSecret)
      Returns a Hasher64 implementing the 64-bit Wyhash (version final 3) algorithm using the given seed values.

      This implementation is compatible with the C++ reference implementation of wyhash and make_secret defined in wyhash.h on an Intel x86 architecture.

      Parameters:
      seed - a 64-bit seed
      seedForSecret - a 64-bit seed for secret generation
      Returns:
      a hasher instance
    • wyhashFinal4

      public static Hasher64 wyhashFinal4()
      Returns a Hasher64 implementing the 64-bit Wyhash (version final 4) algorithm using a seed value of zero and the default secret.

      This implementation is compatible with the C++ reference implementation of wyhash defined in wyhash.h on an Intel x86 architecture.

      Returns:
      a hasher instance
    • wyhashFinal4

      public static Hasher64 wyhashFinal4(long seed)
      Returns a Hasher64 implementing the 64-bit Wyhash (version final 4) algorithm using the given seed value and the default secret.

      This implementation is compatible with the C++ reference implementation of wyhash defined in wyhash.h on an Intel x86 architecture.

      Parameters:
      seed - a 64-bit seed
      Returns:
      a hasher instance
    • wyhashFinal4

      public static Hasher64 wyhashFinal4(long seed, long seedForSecret)
      Returns a Hasher64 implementing the 64-bit Wyhash (version final 4) algorithm using the given seed values.

      This implementation is compatible with the C++ reference implementation of wyhash and make_secret defined in wyhash.h on an Intel x86 architecture.

      Parameters:
      seed - a 64-bit seed
      seedForSecret - a 64-bit seed for secret generation
      Returns:
      a hasher instance
    • farmHashNa

      public static Hasher64 farmHashNa()
      Returns a Hasher64 implementing the 64-bit FarmHashNa algorithm with default seed.

      This implementation is compatible with the C++ reference implementation of farmhashna::Hash64 defined in farmhash.cc on an Intel x86 architecture.

      Returns:
      a hasher instance
    • farmHashNa

      public static Hasher64 farmHashNa(long seed)
      Returns a Hasher64 implementing the 64-bit FarmHashNa algorithm using the given seed value.

      This implementation is compatible with the C++ reference implementation of farmhashna::Hash64WithSeed defined in farmhash.cc on an Intel x86 architecture.

      Parameters:
      seed - the seed
      Returns:
      a hasher instance
    • farmHashNa

      public static Hasher64 farmHashNa(long seed0, long seed1)
      Returns a Hasher64 implementing the 64-bit FarmHashNa algorithm using the given seed values.

      This implementation is compatible with the C++ reference implementation of farmhashna::Hash64WithSeeds defined in farmhash.cc on an Intel x86 architecture.

      Parameters:
      seed0 - the first seed value
      seed1 - the second seed value
      Returns:
      a hasher instance
    • farmHashUo

      public static Hasher64 farmHashUo()
      Returns a Hasher64 implementing the 64-bit FarmHashUo algorithm with default seed.

      This implementation is compatible with the C++ reference implementation of farmhashuo::Hash64 defined in farmhash.cc on an Intel x86 architecture.

      Returns:
      a hasher instance
    • farmHashUo

      public static Hasher64 farmHashUo(long seed)
      Returns a Hasher64 implementing the 64-bit FarmHashUo algorithm using the given seed value.

      This implementation is compatible with the C++ reference implementation of farmhashuo::Hash64WithSeed defined in farmhash.cc on an Intel x86 architecture.

      Parameters:
      seed - the seed
      Returns:
      a hasher instance
    • farmHashUo

      public static Hasher64 farmHashUo(long seed0, long seed1)
      Returns a Hasher64 implementing the 64-bit FarmHashUo algorithm using the given seed values.

      This implementation is compatible with the C++ reference implementation of farmhashuo::Hash64WithSeeds defined in farmhash.cc on an Intel x86 architecture.

      Parameters:
      seed0 - the first seed value
      seed1 - the second seed value
      Returns:
      a hasher instance
    • xxh3_64

      public static Hasher64 xxh3_64()
      Returns a Hasher64 implementing the 64-bit XXH3 algorithm.

      This implementation is compatible with the C++ reference implementation of XXH3_64bits defined in xxhash.h on an Intel x86 architecture.

      Returns:
      a hasher instance
    • xxh3_64

      public static Hasher64 xxh3_64(long seed)
      Returns a Hasher64 implementing the 64-bit XXH3 algorithm using the given seed value.

      This implementation is compatible with the C++ reference implementation of XXH3_64bits_withSeed defined in xxhash.h on an Intel x86 architecture.

      Parameters:
      seed - the seed value
      Returns:
      a hasher instance
    • xxh3_128

      public static Hasher128 xxh3_128()
      Returns a Hasher128 implementing the 128-bit XXH3 algorithm.

      This implementation is compatible with the C++ reference implementation of XXH3_128bits defined in xxhash.h on an Intel x86 architecture.

      Returns:
      a hasher instance
    • xxh3_128

      public static Hasher128 xxh3_128(long seed)
      Returns a Hasher128 implementing the 128-bit XXH3 algorithm using the given seed value.

      This implementation is compatible with the C++ reference implementation of XXH3_128bits_withSeed defined in xxhash.h on an Intel x86 architecture.

      Parameters:
      seed - the seed value
      Returns:
      a hasher instance
    • rapidhash3

      public static Hasher64 rapidhash3()
      Returns a Hasher64 implementing the 64-bit RapidHash v3 algorithm using a seed value of zero and the default secret.

      This implementation is compatible with the C++ reference implementation of rapidhash defined in rapidhash.h on an Intel x86 architecture.

      Returns:
      a hasher instance
    • rapidhash3

      public static Hasher64 rapidhash3(long seed)
      Returns a Hasher64 implementing the 64-bit RapidHash v3 algorithm using the given seed value and the default secret.

      This implementation is compatible with the C++ reference implementation of rapidhash_withSeed defined in rapidhash.h on an Intel x86 architecture.

      Parameters:
      seed - a 64-bit seed
      Returns:
      a hasher instance