npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@httpx/hash

v0.2.4

Published

Collection of hash functions

Readme

@httpx/hash

npm changelog codecov bundles node browserslist downloads license

Install

$ npm install @httpx/hash
$ yarn add @httpx/hash
$ pnpm add @httpx/hash

Features

Documentation

XXHash64 (wasm)

The XXHash is a very fast non-cryptographic hash algorithm. It is designed to be extremely fast while maintaining a low collision rate.

The XXHash64 variant produces a 64-bit hash suitable for checksums, hash tables and databases.

  • [x] Extremely fast.
  • [x] Low collision rate.
  • [x] 64-bit output (bigint, signed64).
  • [x] Passes SMHasher tests.
  • [x] Doesn't fully pass SMHasher3 tests (but still good enough for non-cryptographic use cases).

Check SMHasher and SMHasher3 for more details about quality of hash functions.

Usage

For most projects, you can benefit from top-level await by creating a file named xxHash64.ts. The file will initialize the wasm module and export the hasher instance without async calls in the rest of your code.

import { createXXHash64 } from '@httpx/hash/xxhash-wasm';

// Notice the top-level await as wasm loading is async.
const xxHash64 = await createXXHash64({
  // Optionally provide a seed (default is 0n)
  // For example, Spark uses 42 as a default seed
  defaultSeed: 0n,
});

Use it as follows:

import { xxHash64 } from './xxHash64';

// Javascript Bigint output as 64-bit unsigned integer
const hashedBigint = xxHash64.toBigint('some input string');

// Javascript Bigint output as 64-bit signed integer
// Same as `BigInt.asIntN(64, xxHash64.toBigint('some input string'))`
const hashedSigned64 = xxHash64.toSigned64('some input string');

Benchmarks

Performance is continuously monitored thanks to codspeed.io.

CodSpeed Badge

 RUN  v3.2.4 /home/sebastien/github/httpx/packages/hash

 ✓ bench/compare/xxhash.bench.ts > xxHash64 2823ms
     name                  hz     min     max    mean     p75     p99    p995    p999     rme  samples
   · toBigint    1,741,422.57  0.0002  1.0043  0.0006  0.0007  0.0011  0.0013  0.0039  ±0.89%   870712
   · toSigned64  1,630,206.76  0.0003  0.8919  0.0006  0.0007  0.0013  0.0015  0.0079  ±1.17%   815106

See benchmark file for details.

Bundle size

Bundle size is tracked by a size-limit configuration

| Scenario (esm) | Size (compressed) | |------------------------------------------------------------|------------------:| | import { createXXHash64 } from '@httpx/hash/xxhash-wasm' | ~ 765B (*) |

(*) Add 2.3KB gzipped for the wasm file.

Compatibility

| Level | CI | Description | |--------------|----|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Node | ✅ | CI for 20.x, 22.x, 24.x & 25.x. | | Browser | ✅ | Tested with latest chrome (vitest/playwright) | | Browserslist | ✅ | > 95% on 01/2025. defaults, chrome >= 96, firefox >= 105, edge >= 113, safari >= 15, ios >= 15, opera >= 103, not dead | | Edge | ✅ | Ensured on CI with @vercel/edge-runtime. | | Bun | ✅ | Tested with latest (at time of writing >= 1.3.3) | | Cloudflare | ✅ | Ensured with @cloudflare/vitest-pool-workers (see wrangler.toml | | Typescript | ✅ | TS 5.0 + / are-the-type-wrong checks on CI. | | ES2022 | ✅ | Dist files checked with es-check | | Performance | ✅ | Monitored with codspeed.io |

For older browsers: most frontend frameworks can transpile the library (ie: nextjs...)

Comparison with other libraries

Contributors

Contributions are welcome. Have a look to the CONTRIBUTING document.

Sponsors

If my OSS work brightens your day, let's take it to new heights together! Sponsor, coffee, or star – any gesture of support fuels my passion to improve. Thanks for being awesome! 🙏❤️

Special thanks to

License

MIT © Sébastien Vanvelthem and contributors.