Package org.seedstack.seed.crypto
Class Hash
- java.lang.Object
-
- org.seedstack.seed.crypto.Hash
-
public class Hash extends Object
A Hash is the couple made of two byte arrays : the hashed string and the salt used to hash it. When comparing two hashes made with the same salt, it has to be also through the same algorithm with the same parameters.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getHash()Returns the hash.StringgetHashAsString()Returns the hash as a string.byte[]getSalt()Returns the salt.StringgetSaltAsString()Returns the salt as a string.StringtoString()Returns the Hash formatted as "hash:salt".
-
-
-
Method Detail
-
getHash
public byte[] getHash()
Returns the hash.- Returns:
- a byte array being the hash.
-
getSalt
public byte[] getSalt()
Returns the salt.- Returns:
- a byte array being the salt.
-
getHashAsString
public String getHashAsString()
Returns the hash as a string.- Returns:
- the hash as a string.
-
getSaltAsString
public String getSaltAsString()
Returns the salt as a string.- Returns:
- the salt as a string.
-
-