Coconstructor
Bun

constructor

CryptoHasher.constructor

constructor CryptoHasher(
hmacKey?: string | TypedArray<ArrayBufferLike>

Create a new hasher

@param algorithm

The algorithm to use. See algorithms for a list of supported algorithms

@param hmacKey

Optional key for HMAC. Must be a string or TypedArray. If not provided, the hasher will be a non-HMAC hasher.

Referenced types

type SupportedCryptoAlgorithms = 'blake2b256' | 'blake2b512' | 'md4' | 'md5' | 'ripemd160' | 'sha1' | 'sha224' | 'sha256' | 'sha384' | 'sha512' | 'sha512-224' | 'sha512-256' | 'sha3-224' | 'sha3-256' | 'sha3-384' | 'sha3-512' | 'shake128' | 'shake256'

class CryptoHasher

Hardware-accelerated cryptographic hash functions

Used for crypto.createHash()