deno.land / std@0.224.0 / crypto / _fnv / mod.ts

View Documentation
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-2024 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 function fnv(name: string, buf?: Uint8Array): 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

Version Info

Tagged at
6 months ago