Enum Hash

java.lang.Object
java.lang.Enum<Hash>
org.hyperledger.fabric.client.Hash
All Implemented Interfaces:
Serializable, Comparable<Hash>, Function<byte[],byte[]>

public enum Hash extends Enum<Hash> implements Function<byte[],byte[]>
Hash function implementations used to generate a digest of a supplied message.
  • Enum Constant Details

    • NONE

      public static final Hash NONE
      Returns the input message unchanged. This can be used if the signing implementation requires the full message bytes, not just a pre-generated digest, such as Ed25519.
    • SHA256

      public static final Hash SHA256
      SHA-256 hash.
    • SHA384

      public static final Hash SHA384
      SHA-384 hash.
    • SHA3_256

      public static final Hash SHA3_256
      SHA3-256 hash.
    • SHA3_384

      public static final Hash SHA3_384
      SHA3-384 hash.
  • Method Details

    • values

      public static Hash[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Hash valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • sha256

      @Deprecated public static byte[] sha256(byte[] message)
      Deprecated.
      Replaced by SHA256
      SHA-256 hash the supplied message to create a digest for signing.
      Parameters:
      message - Message to be hashed.
      Returns:
      Message digest.
    • apply

      public byte[] apply(byte[] message)
      Hash the supplied message to create a digest for signing.
      Specified by:
      apply in interface Function<byte[],byte[]>
      Parameters:
      message - Message to be hashed.
      Returns:
      Message digest.