deno.land / std@0.118.0 / crypto

import * as mod from "https://deno.land/std@0.118.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.118.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")),
);
std
Deno standard library
GitHub Stars
2178
Go to latest

Version Info

Tagged at
6 months ago