Class BitMixer


  • public final class BitMixer
    extends java.lang.Object
    Bit mixing utilities. The purpose of these methods is to evenly distribute key space over int32 range.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int PHI_C32  
      private static long PHI_C64  
    • Constructor Summary

      Constructors 
      Constructor Description
      BitMixer()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int mix​(byte key)  
      static int mix​(byte key, int seed)  
      static int mix​(char key)  
      static int mix​(char key, int seed)  
      static int mix​(double key)  
      static int mix​(double key, int seed)  
      static int mix​(float key)  
      static int mix​(float key, int seed)  
      static int mix​(int key)  
      static int mix​(int key, int seed)  
      static int mix​(long key)  
      static int mix​(long key, int seed)  
      static int mix​(short key)  
      static int mix​(short key, int seed)  
      static int mix​(java.lang.Object key)  
      static int mix​(java.lang.Object key, int seed)  
      static int mix32​(int k)
      MH3's plain finalization step.
      static long mix64​(long z)
      Computes David Stafford variant 9 of 64bit mix function (MH3 finalization step, with different shifts and constants).
      static int mixPhi​(byte k)  
      static int mixPhi​(char k)  
      static int mixPhi​(double k)  
      static int mixPhi​(float k)  
      static int mixPhi​(int k)  
      static int mixPhi​(long k)  
      static int mixPhi​(short k)  
      static int mixPhi​(java.lang.Object k)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BitMixer

        public BitMixer()
    • Method Detail

      • mix

        public static int mix​(byte key)
      • mix

        public static int mix​(byte key,
                              int seed)
      • mix

        public static int mix​(short key)
      • mix

        public static int mix​(short key,
                              int seed)
      • mix

        public static int mix​(char key)
      • mix

        public static int mix​(char key,
                              int seed)
      • mix

        public static int mix​(int key)
      • mix

        public static int mix​(int key,
                              int seed)
      • mix

        public static int mix​(float key)
      • mix

        public static int mix​(float key,
                              int seed)
      • mix

        public static int mix​(double key)
      • mix

        public static int mix​(double key,
                              int seed)
      • mix

        public static int mix​(long key)
      • mix

        public static int mix​(long key,
                              int seed)
      • mix

        public static int mix​(java.lang.Object key)
      • mix

        public static int mix​(java.lang.Object key,
                              int seed)
      • mix32

        public static int mix32​(int k)
        MH3's plain finalization step.
      • mix64

        public static long mix64​(long z)
        Computes David Stafford variant 9 of 64bit mix function (MH3 finalization step, with different shifts and constants). Variant 9 is picked because it contains two 32-bit shifts which could be possibly optimized into better machine code.
        See Also:
        "http://zimbry.blogspot.com/2011/09/better-bit-mixing-improving-on.html"
      • mixPhi

        public static int mixPhi​(byte k)
      • mixPhi

        public static int mixPhi​(char k)
      • mixPhi

        public static int mixPhi​(short k)
      • mixPhi

        public static int mixPhi​(int k)
      • mixPhi

        public static int mixPhi​(float k)
      • mixPhi

        public static int mixPhi​(double k)
      • mixPhi

        public static int mixPhi​(long k)
      • mixPhi

        public static int mixPhi​(java.lang.Object k)