(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 | BufferSourcealgorithm
- 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.