deno.land / std@0.157.0 / crypto / _fnv / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.// This module is browser compatible.
import { fnv32, fnv32a } from "./fnv32.ts";import { fnv64, fnv64a } from "./fnv64.ts";
export const fnv = (name: string, buf: Uint8Array | undefined): ArrayBuffer => { if (!buf) { throw new TypeError("no data provided for hashing"); }
switch (name) { case "FNV32": return fnv32(buf); case "FNV64": return fnv64(buf); case "FNV32A": return fnv32a(buf); case "FNV64A": return fnv64a(buf); default: throw new TypeError(`unsupported fnv digest: ${name}`); }};
std
Deno standard library
GitHub Repositorydenoland/deno_std
GitHub Stars
2458

Version Info

Tagged at
4 months ago