Class Djb2


  • public final class Djb2
    extends Object
    An implementation of the djb2 hash function.
    • Constructor Detail

      • Djb2

        public Djb2()
    • Method Detail

      • hash

        public static int hash​(String str)
        An implementation of Dan Bernstein's djb2 hash function which is slightly modified. Instead of the initial hash being 5381, it is zero.
        Parameters:
        str - The string to hash.
        Returns:
        The hash code.