New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@libn/nchf

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libn/nchf

Non-cryptographic hash functions.

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

@libn/nchf

Non-cryptographic hash functions.

oaat

32-bit seeded hash.

import { oaat32 } from "@libn/nchf/oaat";

oaat32(new Uint8Array([0, 1, 2, 3]), 0); // e7d12840
oaat32(new Uint8Array([0, 1, 2, 3]), 1); // 80ea5ab8
oaat32(new Uint8Array([0, 1, 2, 4]), 0); // 9080e04c

a5hash

32-bit and 64-bit seeded hashes.

import { a5hash32, a5hash64 } from "@libn/nchf/a5hash";

a5hash32(new Uint8Array([0, 1, 2, 3]), 0); // 5c78d6a6
a5hash32(new Uint8Array([0, 1, 2, 3]), 1); // 97c63c95
a5hash32(new Uint8Array([0, 1, 2, 4]), 0); // d252f967

a5hash64(new Uint8Array([0, 1, 2, 3]), 0n); // 72585f77d63bbd56
a5hash64(new Uint8Array([0, 1, 2, 3]), 1n); // 7b8fd954a91ba3ed
a5hash64(new Uint8Array([0, 1, 2, 4]), 0n); // c6ab2ffce1a74b56

halfsiphash

32-bit and 64-bit keyed hashes.

import { halfsiphash32, halfsiphash64 } from "@libn/nchf/halfsiphash";

const key0 = new Uint8Array(8);
const key1 = key0.with(0, 1);
halfsiphash32(new Uint8Array([0, 1, 2, 3]), key0); // abeeaa6d
halfsiphash32(new Uint8Array([0, 1, 2, 3]), key1); // f167aa09
halfsiphash32(new Uint8Array([0, 1, 2, 4]), key0); // 26affe00

halfsiphash64(new Uint8Array([0, 1, 2, 3]), key0); // 5ad7d3cf8dcbf2b9
halfsiphash64(new Uint8Array([0, 1, 2, 3]), key1); // a2c6ee6ab51b12fa
halfsiphash64(new Uint8Array([0, 1, 2, 4]), key0); // 6dbe762a1eb369ba

FAQs

Package last updated on 13 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts