Create a new hasher
Symbol
CryptoHasher.constructor
The algorithm to use. See algorithms for a list of supported algorithms
Optional key for HMAC. Must be a string or TypedArray
. If not provided, the hasher will be a non-HMAC hasher.
Referenced types
class CryptoHasher
Hardware-accelerated cryptographic hash functions
Used for crypto.createHash()
- readonly static algorithms: SupportedCryptoAlgorithms[]
List of supported hash algorithms
These are hardware accelerated with BoringSSL
Perform a deep copy of the hasher
Finalize the hash. Resets the CryptoHasher so it can be reused.
@param encodingDigestEncoding
to return the hash in. If none is provided, it will return aUint8Array
.Finalize the hash and return a
Buffer
Finalize the hash
@param hashIntoTypedArray
to write the hash into. Faster than creating a new one each timeUpdate the hash with data
Run the hash over the given data
@param inputstring
,Uint8Array
, orArrayBuffer
to hash.Uint8Array
orArrayBuffer
is faster.static hash(algorithm: SupportedCryptoAlgorithms, input: BlobOrStringOrBuffer, hashInto: TypedArray): TypedArrayRun the hash over the given data
@param inputstring
,Uint8Array
, orArrayBuffer
to hash.Uint8Array
orArrayBuffer
is faster.@param hashIntoTypedArray
to write the hash into. Faster than creating a new one each timestatic hash(algorithm: SupportedCryptoAlgorithms, input: BlobOrStringOrBuffer, encoding: DigestEncoding): stringRun the hash over the given data
@param inputstring
,Uint8Array
, orArrayBuffer
to hash.Uint8Array
orArrayBuffer
is faster.@param encodingDigestEncoding
to return the hash in