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

@node-rs/xxhash

v1.7.7

Published

Fastest xxhash implementation in Node.js

Downloads

4,120,918

Readme

@node-rs/xxhash

Install size

🚀 Help me to become a full-time open-source developer by sponsoring me on Github

xxhash-rust binding for Node.js.

Install this package

yarn add @node-rs/xxhash
pnpm add @node-rs/xxhash
npm install @node-rs/xxhash

API

export type BufferLike =
  | Buffer
  | string
  | Uint8Array
  | ArrayBuffer
  | SharedArrayBuffer
  | ReadonlyArray<number>
  | number[]

export function xxh32(input: BufferLike, seed?: number): number
export function xxh64(input: BufferLike, seed?: BigInt): BigInt

export class Xxh32 {
  constructor(seed?: number)
  update(input: BufferLike): this
  digest(): number
  reset(): void
}

export class Xxh64 {
  constructor(seed?: BigInt)
  update(input: BufferLike): this
  digest(): BigInt
  reset(): void
}

export class Xxh3 {
  static withSeed(seed?: BigInt): Xxh3
  static withSecret(secret: BufferLike): Xxh3
  private constructor() {}
  update(input: BufferLike): this
  digest(): BigInt
  reset(): void
}

export const xxh3: {
  xxh64: (input: BufferLike, seed?: BigInt) => BigInt
  xxh64WithSecret: (input: BufferLike, secret: BufferLike) => BigInt
  xxh128: (input: BufferLike, seed?: BigInt) => BigInt
  xxh128WithSecret: (input: BufferLike, secret: BufferLike) => BigInt
  Xxh3: typeof Xxh3
}

Performance

Hardware

                  ,MMMM.           Host        -  xxxxxxxxxxxxxxxxxxxxxxx
                .MMMMMM            Machine     -  Mac15,9
                MMMMM,             Kernel      -  24.0.0
      .;MMMMM:' MMMMMMMMMM;.       OS          -  macOS 15.0.1 Sequoia
    MMMMMMMMMMMMNWMMMMMMMMMMM:     DE          -  Aqua
  .MMMMMMMMMMMMMMMMMMMMMMMMWM.     WM          -  Quartz Compositor
  MMMMMMMMMMMMMMMMMMMMMMMMM.       Packages    -  194 (Homebrew), 32 (cargo)
 ;MMMMMMMMMMMMMMMMMMMMMMMM:        Shell       -  zsh
 :MMMMMMMMMMMMMMMMMMMMMMMM:        Terminal    -  warpterminal (Version v0.2024.10.23.14.49.stable_00)
 .MMMMMMMMMMMMMMMMMMMMMMMMM.       Resolution  -  5120x2880@160fps (as 2560x1440)
  MMMMMMMMMMMMMMMMMMMMMMMMMMM.                    2992x1934@120fps (as 1496x967)
   .MMMMMMMMMMMMMMMMMMMMMMMMMM.                   2232x1512@60fps (as 1116x756)
     MMMMMMMMMMMMMMMMMMMMMMMM      Uptime      -  1d 2h 32m
      ;MMMMMMMMMMMMMMMMMMMM.       CPU         -  Apple M3 Max (16)
        .MMMM,.    .MMMM,.         CPU Load    -  16%
                                   Memory      -  50.1 GB / 134.2 GB
                                   Battery     -  78% & Discharging
                                   Disk Space  -  624.0 GB / 994.7 GB

Result

❯ yarn workspace @node-rs/xxhash bench
xxh32 without initial seed
┌─────────┬───────────────────────┬──────────┬───────────────────┬──────────┬─────────┐
│ (index) │ Task Name             │ ops/sec  │ Average Time (ns) │ Margin   │ Samples │
├─────────┼───────────────────────┼──────────┼───────────────────┼──────────┼─────────┤
│ 0       │ '@node-rs/xxhash h32' │ '20,146' │ 49637.20101250711 │ '±0.20%' │ 10074   │
│ 1       │ 'xxhash c++'          │ '17,348' │ 57642.4387319887  │ '±0.19%' │ 8675    │
│ 2       │ 'xxhashjs h32'        │ '2,697'  │ 370657.902149741  │ '±0.24%' │ 1349    │
└─────────┴───────────────────────┴──────────┴───────────────────┴──────────┴─────────┘
xxh32 without initial seed multi step
┌─────────┬───────────────────────┬──────────┬────────────────────┬──────────┬─────────┐
│ (index) │ Task Name             │ ops/sec  │ Average Time (ns)  │ Margin   │ Samples │
├─────────┼───────────────────────┼──────────┼────────────────────┼──────────┼─────────┤
│ 0       │ '@node-rs/xxhash h32' │ '17,111' │ 58440.61746142987  │ '±0.20%' │ 8556    │
│ 1       │ 'xxhashjs h32'        │ '2,738'  │ 365160.82262773765 │ '±0.19%' │ 1370    │
└─────────┴───────────────────────┴──────────┴────────────────────┴──────────┴─────────┘
xxh64 without initial seed
┌─────────┬──────────────────────┬──────────┬────────────────────┬──────────┬─────────┐
│ (index) │ Task Name            │ ops/sec  │ Average Time (ns)  │ Margin   │ Samples │
├─────────┼──────────────────────┼──────────┼────────────────────┼──────────┼─────────┤
│ 0       │ '@node-rs/xxhash 64' │ '50,159' │ 19936.33995215147  │ '±0.11%' │ 25080   │
│ 1       │ 'xxhash C++'         │ '47,980' │ 20841.790588135264 │ '±0.17%' │ 23991   │
│ 2       │ 'wasm'               │ '33,916' │ 29484.03756117805  │ '±0.21%' │ 16959   │
│ 3       │ 'xxhashjs h64'       │ '95'     │ 10431058.97916674  │ '±0.57%' │ 48      │
└─────────┴──────────────────────┴──────────┴────────────────────┴──────────┴─────────┘
xxh64 without initial seed multi step
┌─────────┬──────────────────────┬──────────┬────────────────────┬──────────┬─────────┐
│ (index) │ Task Name            │ ops/sec  │ Average Time (ns)  │ Margin   │ Samples │
├─────────┼──────────────────────┼──────────┼────────────────────┼──────────┼─────────┤
│ 0       │ '@node-rs/xxhash 64' │ '46,603' │ 21457.79825765685  │ '±0.20%' │ 23302   │
│ 1       │ 'wasm'               │ '34,681' │ 28834.205985814675 │ '±0.19%' │ 17341   │
│ 2       │ 'xxhashjs h64'       │ '96'     │ 10411336.75510195  │ '±0.73%' │ 49      │
└─────────┴──────────────────────┴──────────┴────────────────────┴──────────┴─────────┘