StaticdigestGenerates a cryptographic hash of the given data using the specified algorithm. This method replicates crypto.subtle.digest() from the Web Crypto API, suitable for SHA and other algorithms.
algorithm The hash algorithm to use (e.g., "SHA1", "SHA256", "SHA384", "SHA512").
data The data to hash.
Returns: A Promise that resolves to the hashed output as an Uint8Array.
The
Crypto.subtleread-only property returns an object which can then be used to perform low-level cryptographic operations.