org.modeshape.common.util

## Enum SecureHash.Algorithm

- java.lang.Object
- - java.lang.Enum<SecureHash.Algorithm>
  - - org.modeshape.common.util.SecureHash.Algorithm

- All Implemented Interfaces:
    Serializable, Comparable<SecureHash.Algorithm>
  Enclosing class:
    SecureHash

      @Immutable
      public static enum SecureHash.Algorithm
      extends Enum<SecureHash.Algorithm>

  Commonly-used hashing algorithms.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `MD2`
    `MD5`
    `SHA_1`
    `SHA_256`
    `SHA_384`
    `SHA_512`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `description()`
    `String` | `digestName()`
    `int` | `getHexadecimalStringLength()` Get the length of the hexadecimal representation.
    `int` | `getNumberOfBits()` Get the number of bits that make up a digest.
    `int` | `getNumberOfBytes()` Get the length of the hexadecimal representation.
    `String` | `toString()`
    `static SecureHash.Algorithm` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static SecureHash.Algorithm[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### MD2

          public static final SecureHash.Algorithm MD2

    - #### MD5

          public static final SecureHash.Algorithm MD5

    - #### SHA_1

          public static final SecureHash.Algorithm SHA_1

    - #### SHA_256

          public static final SecureHash.Algorithm SHA_256

    - #### SHA_384

          public static final SecureHash.Algorithm SHA_384

    - #### SHA_512

          public static final SecureHash.Algorithm SHA_512

  - ### Method Detail

    - #### values

          public static SecureHash.Algorithm[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (SecureHash.Algorithm c : SecureHash.Algorithm.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static SecureHash.Algorithm 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

    - #### digestName

          public String digestName()

    - #### description

          public String description()

    - #### getHexadecimalStringLength

          public int getHexadecimalStringLength()

      Get the length of the hexadecimal representation.
      Returns:
        the number of hexadecimal characters

    - #### getNumberOfBytes

          public int getNumberOfBytes()

      Get the length of the hexadecimal representation.
      Returns:
        the number of hexadecimal characters

    - #### getNumberOfBits

          public int getNumberOfBits()

      Get the number of bits that make up a digest.
      Returns:
        the number of bits

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Enum<SecureHash.Algorithm>`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.