Package anlavn.hash
Class SHA
java.lang.Object
anlavn.hash.SHA
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.
SHA256 uses the Secure Hash Algorithm 2 cryptographic hash function designed by the US National Security Agency with a 256-bit long hash value.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The SHA (Secure Hash Algorithm) Family designates a family of 8 different hash functions. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SHA
public SHA()
-
-
Method Details
-
encrypt
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
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:
-