Hash

Hash

Static only class to hash an input message and produce an output that matches the output of Bifrost FastCrytographicHash

Constructor

new Hash()

Source:

Methods

(static) any(message, encoding) → {function}

Calculates the Blake2b-256 hash of an arbitrary input. This function will apply JSON canonicalization to the given message. Further information regarding JON canonicalization may be found at https://github.com/cyberphone/json-canonicalization
Source:
Parameters:
Name Type Description
message any input message to create the hash digest of
encoding string output encoding
Returns:
Type:
function
digestAndEncode returns Blake2b-256 hash digest

(static) file(filePath, encoding) → {promise}

Reads the file from disk and calculates the Blake2b-256
Source:
Parameters:
Name Type Description
filePath string path to the input file
encoding string output encoding
Returns:
Type:
promise
on "finish" -> Blake2b-256 hash digest

(static) string(message, encoding) → {function}

Calculates the Blake2b-256 of a string input
Source:
Parameters:
Name Type Description
message string input string message to create the hash digest of
encoding string output encoding
Returns:
Type:
function
digestAndEncode returns Blake2b-256 hash digest