Packages

@noble/hashes

2.4.0 · 27 Aug 2026MIT155.8M / weekRepositoryHomepagenpmAtom feed

Your version

2.0.0

major25 Aug 2025Where it was published

2.4.0 is the newest release of 2.x.

In short

8 changed

Release note

High-level

  • The package is now ESM-only. ESM can finally be loaded from common.js on node v20.19+

    • Node v20.19 is now the minimum required version

    • Package imports now work correctly in bundler-less environments, such as browsers

    • Reduces npm package size (traffic consumed): 152KB => 136KB

    • Reduces unpacked npm size (on-disk space): 1.1MB => 669KB

  • Make bundle sizes smaller, compared to v1.x

  • .js extension must be used for all modules

    • Old: @noble/hashes/sha3

    • New: @noble/hashes/sha3.js

    • This simplifies working in browsers natively without transpilers

Changes

  • Only allow Uint8Array as hash inputs, prohibit string

    • Strict validation checks improve security

    • To replicate previous behavior, use utils.utf8ToBytes

  • Rename / remove some modules for consistency. Previously, sha384 resided in sha512, which was weird

    • sha256, sha512 => sha2.js (consistent with sha3.js)

    • blake2b, blake2s => blake2.js (consistent with blake3.js, blake1.js)

    • ripemd160, sha1, md5 => legacy.js (all low-security hashes are there)

    • _assert => utils.js

    • crypto internal module got removed: use built-in WebCrypto instead

  • Improve typescript types & option autocomplete

  • Upgrade typescript compilation env to ts5.9 and es2022

  • Massively improve error messages, make them more descriptive

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.