The Hasher class is in charge of create and validate hashes given a payload
Visibility | Function |
---|---|
public | __construct(string $privateKey) : void Hasher constructor, both parts of the communication, have to use the same private key. |
public | hash(string $payload) : string Create a hash given a payload |
public | isValid(string $payload, string $hash) : bool Validate a hash given a payload |
To generate a new hash execute:
./hasher hash <private_key> <payload>
To check if a hash is valid execute: <<<<<<< HEAD
./hasher check <private_key> <payload> <hash>