1.0.0 • Published 8 months ago

chibihash-js v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

chibihash-js

A TypeScript (JS) implementation of N-R-K/ChibiHash v2.

Installation

npm install chibihash-js

Usage

import {chibihash64 /* or chibihash64_v2 */} from 'chibihash-js';
import * as crypto from 'node:crypto';

// You need to specify a seed value.
console.log(chibihash64('Hello, world!', 0n)); // Output: 12391912970407575239n

// Seed must be a 64-bit unsigned bigint value.
const seed = crypto.randomBytes(8).readBigUInt64BE(0);
console.log(chibihash64('Hello, world!', seed));

License

MIT License

Copyright (c) 2024 KOMIYA Atsushi.

1.0.0

8 months ago