Package anlavn.hash

Class SHA

java.lang.Object
anlavn.hash.SHA

public class SHA extends Object
The SHA256 class only supports object encryption, decryption it is impossible. Make sure your object class was "implements Serializable".
SHA256 uses the Secure Hash Algorithm 2 cryptographic hash function designed by the US National Security Agency with a 256-bit long hash value.
  • Constructor Details

    • SHA

      public SHA()
  • Method Details

    • encrypt

      public static final String encrypt(SHA.Types type, Object objToEncrypt)
      Use this method to encrypt the original object.
      Parameters:
      type - is the type in SHA Family use to encrypt.
      objToEncrypt - is the object need encrypt.
      Returns:
      a SHA256 hash code of the original object.
      See Also:
    • encrypt

      public static final String encrypt(SHA.Types type, String strToEncrypt)
      Use this method to encrypt the original string.
      Parameters:
      type - is the type in SHA Family use to encrypt.
      strToEncrypt - is the string need encrypt.
      Returns:
      a SHA256 hash code of the original string.
      See Also: