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

@bybrave/object-hash2

v4.0.0

Published

Maintained fork of object-hash — generate hashes from javascript objects in node and the browser. Identical hashes in both, repeated references fixed, 2x faster, 2 KB browser bundle.

Readme

@bybrave/object-hash2

CI npm

Maintained fork of object-hash — generate hashes from any javascript value, in Node.js and the browser.

The original has ~320M downloads/month and no release since 2022. This fork keeps the same API and fixes what was broken underneath: repeated references, browser/node divergence, the prototype-graph walk that halved performance.

npm install @bybrave/object-hash2
// CommonJS — drop-in
const hash = require("@bybrave/object-hash2");

// ESM
import hash from "@bybrave/object-hash2";

hash({ foo: "bar" });                       // 'a02...'
hash({ foo: "bar" }, { algorithm: "md5" }); // '132...'
hash.keys({ foo: "bar" });                  // keys only

Same options as the original: algorithm, encoding, excludeValues, excludeKeys, replacer, respectType, respectFunctionProperties, respectFunctionNames, unorderedArrays, unorderedSets, unorderedObjects, ignoreUnknown — see the original documentation.

What's different from object-hash 3.0.0

| Change | Original issue | |---|---| | Repeated (non-circular) references hash like copies: hash([a, a]) === hash([[1,2], [1,2]]). Real cycles are still detected | #78 | | Identical hashes in Node.js and the browser, byte for byte — the browser build runs the same serializer with own md5/sha1/sha256 (fuzz-checked against node:crypto) | #62 | | Browser bundle 4.5 KB gzipped instead of ~10 KB (no more crypto-browserify) | #91 | | ~2x faster with default options: the respectType prototype-graph walk replaced with a compact type marker | perf reports | | respectType no longer reads __proto__/constructor/prototype of foreign objects — no more crashes on classes with throwing prototype getters (Mongo ObjectID & co) | #49 | | Buffer, Uint8Array, Uint8ClampedArray, ArrayBuffer and DataView with the same bytes hash the same | — | | DataView hashes by content (the original hashed every DataView to the same constant) | — | | TypeScript definitions shipped with the package (compatible with @types/object-hash) | — | | ESM entry (import hash from "@bybrave/object-hash2") + exports map | — | | Build: esbuild instead of gulp + browserify; CI on Node 18/20/22; zero runtime dependencies (as before) | — |

Hash compatibility with 3.x — read before upgrading

This is a major release and some hashes change. If you persist hashes (cache keys, deduplication), regenerate them on upgrade — the original did the same in its 2.x → 3.x major.

Unchanged (byte-identical to 3.0.0, pinned by tests):

  • primitives, strings, dates, regexps, URLs, errors, symbols, bigints, numeric typed arrays — with any options;
  • everything hashed with respectType: false, as long as the value has no repeated references and no binary types listed below.

Changed:

  • default-options hashes of values containing objects or functions (respectType: true used to serialize the whole prototype graph — that walk is now a compact marker);
  • values with repeated references (that's the #78 fix);
  • Buffer / Uint8Array / Uint8ClampedArray / ArrayBuffer / DataView values (unified byte serialization, identical across platforms);
  • hashes produced in the browser (they now match Node.js — that's the point).

Compatibility

  • API is unchanged — drop-in replacement for object-hash: hash(), hash.sha1(), hash.keys(), hash.MD5(), hash.keysMD5(), hash.writeToStream().
  • Node.js ≥ 18; modern browsers. Browser algorithms: md5, sha1, sha256 (+ passthrough); in Node.js everything from crypto.getHashes().
  • Browser <script> builds: dist/object_hash.js and dist/object_hash.min.js (global objectHash), shipped in the npm package.

Support

If this package saves you time, you can support maintenance:

Ko-fi Bitcoin

Bitcoin (BTC): bc1q37557q5jpeaxqydzwvf3jgj7zhnfpn2td3q40q

Credits & license

MIT, same as the original — see LICENSE. Based on object-hash by Scott Puleo and contributors.