import { sha1 } from "https://deno.land/x/ayonli_jsext@v0.9.72/hash.ts";
Calculates the SHA-1 hash of the given data.
Examples
Example 1
Example 1
import { sha1 } from "@ayonli/jsext/hash";
const buffer = await sha1("Hello, World!");
console.log(buffer); // ArrayBuffer(20) { ... }
Parameters
data: DataSource
Examples
Example 1
Example 1
import { sha1 } from "@ayonli/jsext/hash";
const hex = await sha1("Hello, World!", "hex");
console.log(hex); // 0a0a9f2a6772942557ab5355d76af442f8f65e01
const base64 = await sha1("Hello, World!", "base64");
console.log(base64); // CgqfKmdylCVXq1NV12r0Qvj2XgE=
Parameters
data: DataSource