AcediaDocumentation

crypt.hash

Computes a hash and returns lowercase hexadecimal text.

Algorithm names are case-sensitive. This returns hex, unlike the Base64 result of crypt.hmac.

crypt.hash(data: string, algorithm: string?): string

Parameters

ParameterTypeDescription
datastringRaw input bytes.
algorithmstring?Defaults to sha256; also sha224, sha384, sha512, sha1 and md5.

Errors: Unknown algorithm names raise an error.

On this page