import { toHashString } from "https://dotland.deno.dev/x/lume@v1.14.1/deps/crypto.ts";
Converts a hash to a string with a given encoding.
Examples
Example 1
Example 1
import { crypto, toHashString } from "https://deno.land/std@$STD_VERSION/crypto/mod.ts";
const hash = await crypto.subtle.digest("SHA-384", new TextEncoder().encode("You hear that Mr. Anderson?"));
// Hex encoding by default
console.log(toHashString(hash));
// Or with base64 encoding
console.log(toHashString(hash, "base64"));