public interface Hasher
| Modifier and Type | Method and Description |
|---|---|
byte[] |
generateSalt()
Provides access to a salt for this specific hasher.
|
HashHolder |
hash(byte[] bytes)
Will hash the bytes given and return a 'sized' salted hash depending on the algorithm picked on creation.
|
byte[] |
hash(byte[] salt,
byte[] bytesToHash)
Will hash the bytes given and return a 'sized' salted hash depending on the algorithm picked on creation.
|
byte[] |
hash(byte[] salt,
java.lang.String hashingWord)
Will hash the bytes given and return a 'sized' salted hash depending on the algorithm picked on creation.
|
HashHolder |
hash(java.lang.String hashingWord)
Will hash the bytes given and return a 'sized' salted hash depending on the algorithm picked on creation.
|
boolean |
isSame(byte[] salt,
byte[] previousHash,
byte[] payload)
Compares a previously hashed set of bytes with a new payload.
|
boolean |
isSame(byte[] salt,
byte[] previousHash,
java.lang.String payload)
Compares a previously hashed set of bytes with a new payload.
|
boolean |
isSame(HashHolder hashHolder,
byte[] payload)
Compares a previously hashed set of bytes with a new payload.
|
boolean |
isSame(HashHolder hashHolder,
java.lang.String payload)
Compares a previously hashed set of bytes with a new payload.
|
HashHolder hash(byte[] bytes)
bytes - from the payload.HashHolder hash(java.lang.String hashingWord)
hashingWord - for the payload, converted to bytes in a consistent way for this hasher.byte[] hash(byte[] salt,
byte[] bytesToHash)
salt - that was used originally to generate the hashbytesToHash - bytes that you want to hash and see what you get.byte[] hash(byte[] salt,
java.lang.String hashingWord)
salt - that was used originally to generate the hashhashingWord - The payload to hash with the salt.byte[] generateSalt()
boolean isSame(HashHolder hashHolder, byte[] payload)
hashHolder - the previously hashed word with salt.payload - The payload to hash with the salt and check against the hashedBytes givenboolean isSame(HashHolder hashHolder, java.lang.String payload)
hashHolder - the previously hashed word with salt.payload - The payload to hash with the salt and check against the hashedBytes givenboolean isSame(byte[] salt,
byte[] previousHash,
java.lang.String payload)
salt - that was used originally to generate the hashpreviousHash - generated from the original text/bytespayload - The incoming payload you want to checkboolean isSame(byte[] salt,
byte[] previousHash,
byte[] payload)
salt - that was used originally to generate the hashpreviousHash - generated from the original text/bytespayload - The incoming payload you want to check