hash.ts

Declarations
#

view source

to_hash
#

hash.ts view source

(data: string | BufferSource, algorithm?: "SHA-1" | "SHA-256" | "SHA-384" | "SHA-512"): Promise<string>

Computes a cryptographic hash of the given data.

data

- String or binary data to hash. Strings are UTF-8 encoded internally.

type string | BufferSource

algorithm

- Hash algorithm to use. Defaults to SHA-256.

type "SHA-1" | "SHA-256" | "SHA-384" | "SHA-512"
default 'SHA-256'

returns

Promise<string>

Hexadecimal hash string.

see also

Imported by
#