summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src/helpers/toHash.test.ts
blob: f5e4d30419c38bddac76ef901e4a46bf1f238790 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { assertEquals } from "https://deno.land/std@0.198.0/assert/mod.ts";

import { toHash } from "./toHash.ts";

Deno.test("should return a buffer of at 32 bytes for input string", async () => {
  const hash = await toHash("string");
  assertEquals(hash.byteLength, 32);
});

Deno.test("should return a buffer of at 32 bytes for input Buffer", async () => {
  const hash = await toHash(new Uint8Array(10).fill(0));
  assertEquals(hash.byteLength, 32);
});