method SubtleCrypto.digest
#SubtleCrypto.digest(algorithm: AlgorithmIdentifier,data: BufferSource,): Promise<ArrayBuffer>
Computes a cryptographic hash (digest) of the given data.
This method is commonly used for verifying data integrity.
Examples #
#
// Compute the digest of given data using a cryptographic algorithm
await crypto.subtle.digest("SHA-256", data);
Parameters #
#algorithm: AlgorithmIdentifier
#data: BufferSource
Return Type #
Promise<ArrayBuffer>