The digestStringAsync() method of Crypto generates a digest of the supplied data string with the provided digest algorithm.
A digest is a short fixed-length value derived from some variable-length input. Cryptographic digests should exhibit collision-resistance, meaning that it's very difficult to generate multiple inputs that have equal digest values.
You can specify the returned string format as one of CryptoEncoding. By default the resolved value will be formatted as a HEX string. On web, this method can only be called from a secure origin (https) otherwise an error will be thrown.
ERR_CRYPTO_UNAVAILABLE - (Web only) Access to the WebCrypto API is restricted to secure origins (https). You can run your web project from a secure origin with expo start --https.
ERR_CRYPTO_DIGEST - An invalid encoding type provided.
Example
const digest =awaitCrypto.digestStringAsync(Crypto.CryptoDigestAlgorithm.SHA512,'🥓 Easy to Digest! 💙');