Class CrossHash.Yolk

java.lang.Object
com.github.yellowstonegames.old.v300.CrossHash.Yolk
Enclosing class:
CrossHash

public static final class CrossHash.Yolk extends Object
Like Mist, this is a class for hash functors, each an object with a 64-bit long seed, but it uses about the same algorithm as CrossHash.Water instead of the older, less-robust style Mist uses. This can be faster than CrossHash.Curlup, but only for small arrays as input (20 length or less); it tends to be slower on larger arrays, though not by much, and should be the same for long[] since they share an implementation for that type. Normally you should prefer Curlup if you know some or all of your arrays will be of moderate size or larger. Has a lot of predefined functors (192, named after 24 Greek letters and 72 Goetic demons, see Wikipedia for the demons, in both lower case and lower case with a trailing underscore). You probably want to use predefined instead of wrangling demon names; you can always choose an element from predefined with a 7-bit number, and there are 64 numbers outside that range so you can choose any of those when a functor must be different.
  • Field Details

  • Constructor Details

    • Yolk

      public Yolk()
    • Yolk

      public Yolk(long seed)
    • Yolk

      public Yolk(CharSequence seed)
  • Method Details

    • hash64

      public long hash64(boolean[] data)
    • hash64

      public long hash64(byte[] data)
    • hash64

      public long hash64(short[] data)
    • hash64

      public long hash64(char[] data)
    • hash64

      public long hash64(CharSequence data)
    • hash64

      public long hash64(int[] data)
    • hash64

      public long hash64(int[] data, int length)
    • hash64

      public long hash64(long[] data)
    • hash64

      public long hash64(float[] data)
    • hash64

      public long hash64(double[] data)
    • hash64

      public long hash64(char[] data, int start, int end)
      Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
      Parameters:
      data - the char array to hash
      start - the start of the section to hash (inclusive)
      end - the end of the section to hash (exclusive)
      Returns:
      a 64-bit hash code for the requested section of data
    • hash64

      public long hash64(CharSequence data, int start, int end)
      Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
      Parameters:
      data - the String or other CharSequence to hash
      start - the start of the section to hash (inclusive)
      end - the end of the section to hash (exclusive)
      Returns:
      a 64-bit hash code for the requested section of data
    • hash64

      public long hash64(char[][] data)
    • hash64

      public long hash64(int[][] data)
    • hash64

      public long hash64(long[][] data)
    • hash64

      public long hash64(CharSequence[] data)
    • hash64

      public long hash64(CharSequence[]... data)
    • hash64

      public long hash64(Iterable<? extends CharSequence> data)
    • hash64

      public long hash64(List<? extends CharSequence> data)
    • hash64

      public long hash64(Object[] data)
    • hash64

      public long hash64(Object data)
    • hash

      public int hash(boolean[] data)
    • hash

      public int hash(byte[] data)
    • hash

      public int hash(short[] data)
    • hash

      public int hash(char[] data)
    • hash

      public int hash(CharSequence data)
    • hash

      public int hash(int[] data)
    • hash

      public int hash(int[] data, int length)
    • hash

      public int hash(long[] data)
    • hash

      public int hash(float[] data)
    • hash

      public int hash(double[] data)
    • hash

      public int hash(char[] data, int start, int end)
      Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
      Parameters:
      data - the char array to hash
      start - the start of the section to hash (inclusive)
      end - the end of the section to hash (exclusive)
      Returns:
      a 32-bit hash code for the requested section of data
    • hash

      public int hash(CharSequence data, int start, int end)
      Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
      Parameters:
      data - the String or other CharSequence to hash
      start - the start of the section to hash (inclusive)
      end - the end of the section to hash (exclusive)
      Returns:
      a 32-bit hash code for the requested section of data
    • hash

      public int hash(char[][] data)
    • hash

      public int hash(int[][] data)
    • hash

      public int hash(long[][] data)
    • hash

      public int hash(CharSequence[] data)
    • hash

      public int hash(CharSequence[]... data)
    • hash

      public int hash(Iterable<? extends CharSequence> data)
    • hash

      public int hash(List<? extends CharSequence> data)
    • hash

      public int hash(Object[] data)
    • hash

      public int hash(Object data)
    • hash64

      public static long hash64(long seed, boolean[] data)
    • hash64

      public static long hash64(long seed, byte[] data)
    • hash64

      public static long hash64(long seed, short[] data)
    • hash64

      public static long hash64(long seed, char[] data)
    • hash64

      public static long hash64(long seed, CharSequence data)
    • hash64

      public static long hash64(long seed, int[] data)
    • hash64

      public static long hash64(long seed, int[] data, int length)
    • hash64

      public static long hash64(long seed, long[] data)
    • hash64

      public static long hash64(long seed, float[] data)
    • hash64

      public static long hash64(long seed, double[] data)
    • hash64

      public static long hash64(long seed, char[] data, int start, int end)
      Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
      Parameters:
      data - the char array to hash
      start - the start of the section to hash (inclusive)
      end - the end of the section to hash (exclusive)
      Returns:
      a 32-bit hash code for the requested section of data
    • hash64

      public static long hash64(long seed, CharSequence data, int start, int end)
      Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
      Parameters:
      data - the String or other CharSequence to hash
      start - the start of the section to hash (inclusive)
      end - the end of the section to hash (exclusive)
      Returns:
      a 32-bit hash code for the requested section of data
    • hash64

      public static long hash64(long seed, char[][] data)
    • hash64

      public static long hash64(long seed, int[][] data)
    • hash64

      public static long hash64(long seed, long[][] data)
    • hash64

      public static long hash64(long seed, CharSequence[] data)
    • hash64

      public static long hash64(long seed, CharSequence[]... data)
    • hash64

      public static long hash64(long seed, Iterable<? extends CharSequence> data)
    • hash64

      public static long hash64(long seed, List<? extends CharSequence> data)
    • hash64

      public static long hash64(long seed, Object[] data)
    • hash64

      public static long hash64(long seed, Object data)
    • hash

      public static int hash(long seed, boolean[] data)
    • hash

      public static int hash(long seed, byte[] data)
    • hash

      public static int hash(long seed, short[] data)
    • hash

      public static int hash(long seed, char[] data)
    • hash

      public static int hash(long seed, CharSequence data)
    • hash

      public static int hash(long seed, int[] data)
    • hash

      public static int hash(long seed, int[] data, int length)
    • hash

      public static int hash(long seed, long[] data)
    • hash

      public static int hash(long seed, float[] data)
    • hash

      public static int hash(long seed, double[] data)
    • hash

      public static int hash(long seed, char[] data, int start, int end)
      Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
      Parameters:
      data - the char array to hash
      start - the start of the section to hash (inclusive)
      end - the end of the section to hash (exclusive)
      Returns:
      a 32-bit hash code for the requested section of data
    • hash

      public static int hash(long seed, CharSequence data, int start, int end)
      Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
      Parameters:
      data - the String or other CharSequence to hash
      start - the start of the section to hash (inclusive)
      end - the end of the section to hash (exclusive)
      Returns:
      a 32-bit hash code for the requested section of data
    • hash

      public static int hash(long seed, char[][] data)
    • hash

      public static int hash(long seed, int[][] data)
    • hash

      public static int hash(long seed, long[][] data)
    • hash

      public static int hash(long seed, CharSequence[] data)
    • hash

      public static int hash(long seed, CharSequence[]... data)
    • hash

      public static int hash(long seed, Iterable<? extends CharSequence> data)
    • hash

      public static int hash(long seed, List<? extends CharSequence> data)
    • hash

      public static int hash(long seed, Object[] data)
    • hash

      public static int hash(long seed, Object data)