Module crypt.api

Enum Class HashAlgorithm

java.lang.Object
java.lang.Enum<HashAlgorithm>
io.github.astrapi69.crypt.api.algorithm.HashAlgorithm
All Implemented Interfaces:
Algorithm, Serializable, Comparable<HashAlgorithm>, Constable

public enum HashAlgorithm extends Enum<HashAlgorithm> implements Algorithm
The enum HashAlgorithm represents the one-way conversion hash algorithms
  • Enum Constant Details

    • SHA_1

      public static final HashAlgorithm SHA_1
      The enum constant for SHA-1 algorithm.
    • SHA_224

      public static final HashAlgorithm SHA_224
      The enum constant for SHA-224 algorithm.
    • SHA_256

      public static final HashAlgorithm SHA_256
      The enum constant for SHA-256 algorithm.
    • SHA_384

      public static final HashAlgorithm SHA_384
      The enum constant for SHA-384 algorithm.
    • SHA_512

      public static final HashAlgorithm SHA_512
      The enum constant for SHA-512 algorithm.
    • SHA1

      public static final HashAlgorithm SHA1
      The enum constant for SHA1 algorithm.
    • SHA224

      public static final HashAlgorithm SHA224
      The enum constant for SHA224 algorithm.
    • SHA256

      public static final HashAlgorithm SHA256
      The enum constant for SHA256 algorithm.
    • SHA384

      public static final HashAlgorithm SHA384
      The enum constant for SHA384 algorithm.
    • SHA512

      public static final HashAlgorithm SHA512
      The enum constant for SHA512 algorithm.
    • UNKNOWN

      public static final HashAlgorithm UNKNOWN
      The enum constant 'UNKNOWN' if the hash algorithm is unknown
  • Field Details

  • Method Details

    • values

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

      public static HashAlgorithm valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getAlgorithm

      public String getAlgorithm()
      Gets the algorithm for encryption or decryption
      Specified by:
      getAlgorithm in interface Algorithm
      Returns:
      the algorithm