Class Sha256PasswordHasher
java.lang.Object
integration.security.Sha256PasswordHasher
- All Implemented Interfaces:
PasswordHasher
Class that takes in the chosen password of a user, and hashes it.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Sha256PasswordHasher
public Sha256PasswordHasher()
-
-
Method Details
-
hash
Method for hashing an inputted password. Uses the SHA-256 algorithm. Transforms the password to a UTF-8 byte-array, then digests it using SHA-256. The bytes are then formatted as a 64-character string.- Specified by:
hashin interfacePasswordHasher- Parameters:
password- the password to hash- Returns:
- a 64-character hash of the password.
- Throws:
RuntimeException- if the hashing fails.
-