Skip to main content
Module

x/simple_utility/mod.ts>cryptoHash

Simplify processing for Deno.
Latest
function cryptoHash
import { cryptoHash } from "https://deno.land/x/simple_utility@v2.1.0/mod.ts";

Derive SHA2 hash value from binary. Default is SHA-256.

Examples

Example 1

const bin = await Deno.readFile("./file");
const hash = await cryptoHash(bin);

Parameters

data: Uint8Array
optional
sha: `SHA-${256 | 384 | 512}`

Returns

Promise<Uint8Array>