Skip to content

CryptoUtil

CryptoUtil~createHash(algorithm, data, [encoding], output) ⇒ Buffer | string

Creates a new hash by given algorithm, data and digest encoding. Defaults to sha256.

Kind: inner method of CryptoUtil
Returns: Buffer | string - if {output} is undefined, a {Buffer} is returned, otherwise a

ParamTypeDescription
algorithmstringthe hash algorithm, default is 'sha256'
dataBuffer | string | TypedArray | DataViewthe data to hash
[encoding]stringoptional, the encoding of the input
output'base64' | 'base64url' | 'binary' | 'hex' | undefinedoptional, the desired output type