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

string-hash-64

v2.0.0

Published

fast djb2-style string hashing returning a 53-bit safe integer

Readme

string-hash-64

npm version test js-standard-style

An improved version of djb2: two djb2-style lanes with different strides (33 and 65599) combined into a 53-bit integer hash that always fits in Number.MAX_SAFE_INTEGER. Returns a number between 0 and 9007199254740991.

const hash = require('string-hash-64')

hash('hello') // 6000404498017767

Collisions, measured against djb2

Zero collisions among the first 300 million sequential integers, djb2 already has 12.6 million duplicate entries in that same batch.

Run npm run test:collisions to reproduce (it grows sequential batches until the first collision; needs ~4GB of RAM and a few minutes).

| | string-hash-64 | djb2 | djb2 (reverse loop) | | --- | ---: | ---: | ---: | | first collision among sequential integers | 318,937,570 | 1,626,086 | 5,004,826 | | duplicate entries in a batch of 300M sequential integers | 0 | 12,608,182 | 10,963,171 | | duplicate entries among 10M random 12-character keys | 0 | 11,896 | 11,728 |

First collision: hash("103939545") === hash("318937570").

Performance

Throughput is on par with djb2 — the two lanes overlap in the JIT'ed loop, so the extra multiply per character does not show up in practice (medians from the same run):

| ns per key | 8 chars | 12 chars | 32 chars | 64 chars | | --- | ---: | ---: | ---: | ---: | | string-hash-64 | 24.6 | 32.5 | 107.5 | 197.8 | | djb2 | 26.2 | 33.5 | 111.1 | 200.9 |

Your machine will differ; the comparison script prints its own table.

Breaking change in 2.0.0

Hash values differ from 1.x. Rehash anything you persisted. The API is unchanged: hash(string) returns a number.

Development

  • npm test: linter + unit tests
  • npm run test:collisions: the full comparison against djb2 above

License

MIT