std@0.116.0/crypto

Deno standard library
GitHub Stars
2187
Go to latest
import * as mod from "https://deno.land/std@0.116.0/crypto/mod.ts";

Variables

crypto

An wrapper for WebCrypto adding support for additional non-standard algorithms, but delegating to the runtime WebCrypto implementation whenever possible.

crypto

Usage

import { crypto } from "https://deno.land/std@0.116.0/crypto/mod.ts";

// This will delegate to the runtime's WebCrypto implementation.
console.log(
  await crypto.subtle.digest(
    "SHA-384",
    new TextEncoder().encode("hello world"),
  ),
);

// This will use a bundled WASM/Rust implementation.
console.log(
  await crypto.subtle.digest("BLAKE3", new TextEncoder().encode("hello world")),
);