Class Hashing


  • public final class Hashing
    extends Object
    Util class that provides hashing functions for drasyl.
    • Field Detail

      • MURMUR3_128

        public static final com.google.common.hash.HashFunction MURMUR3_128
      • SHA256

        public static final com.google.common.hash.HashFunction SHA256
    • Method Detail

      • sha256Hex

        public static String sha256Hex​(String input)
        Generates a SHA-256 hash of the given input.
        Parameters:
        input - the input to hash
        Returns:
        SHA-256 hash of the input
      • sha256Hex

        public static String sha256Hex​(byte[] input)
        Generates a SHA-256 hash of the given input.
        Parameters:
        input - the input to hash
        Returns:
        SHA-256 hash of the input
      • hashCode2Hex

        public static String hashCode2Hex​(com.google.common.hash.HashCode code)
        Converts the given HashCode into a hexadecimal string.
        Parameters:
        code - the hash code to be converted
        Returns:
        hexadecimal string representation of the hash code
      • murmur3x64Hex

        public static String murmur3x64Hex​(String input)
        Generates a hexadecimal representation of the MurMur3x64 hash of the input.
        Parameters:
        input - the input to hash
        Returns:
        MurMur3x64 hash as hexadecimal string
      • murmur3x64Hex

        public static String murmur3x64Hex​(byte[] input)
        Generates a hexadecimal representation of the MurMur3x64 hash of the input.
        Parameters:
        input - the input to hash
        Returns:
        MurMur3x64 hash as hexadecimal string