hash

Bun

Symbol

CryptoHashInterface.hash

static hash(input: BlobOrStringOrBuffer, hashInto?: TypedArray<ArrayBufferLike>): TypedArray

Run the hash over the given data

@param input

string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer is faster.

@param hashInto

TypedArray to write the hash into. Faster than creating a new one each time

static hash(input: BlobOrStringOrBuffer, encoding: DigestEncoding): string

Run the hash over the given data

@param input

string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer is faster.

@param encoding

DigestEncoding to return the hash in

Referenced types

type BlobOrStringOrBuffer = string | NodeJS.TypedArray | ArrayBufferLike | Blob
type DigestEncoding = 'utf8' | 'ucs2' | 'utf16le' | 'latin1' | 'ascii' | 'base64' | 'base64url' | 'hex'