The digest() method generates a cryptographically secure digest of the given data. A digest is a short fixed-length value derived from some input data. The digest() method is commonly used to compute a checksum of data or to verify the integrity of data.
|algorithm||a string or object with a single name string property||Names the hash function to use. Supported values are "SHA-1", "SHA-256", "SHA-384" and "SHA-512". Note that the SHA-1 hash function is not considered safe for cryptographic use.|
|data||ArrayBuffer, TypedArray, or DataView||The data to be digested.|
A Promise that resolves to a new ArrayBuffer containing the digest.