Skip to content

kossnocorp/smolxxh

Repository files navigation

Smol xxHash

Tiny xxHash JS implementation.

It is a modern, faster and smaller alternative to xxhashjs package. It is 3.8x faster and fits in just 381B.

It is just 1.8x slower than xxhash-wasm package.

It features dual CJS/ESM support and built-in TypeScript definitions.

It is based on a reference C implementation

Installation

The package is available on npm:

npm install smolxxh

Usage

Pass Buffer or Uint8Array to xxh32 function to get the hash of the content:

import { xxh32 } from "smolxxh";

xxh32(Buffer.from("hello world", "utf8")).toString(16);
// => 0x31b7405d

Changelog

See the changelog.

License

MIT © Sasha Koss

About

Tiny xxHash JS implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published