npm / @noble/hashes
@noble/hashes
What changed in @noble/hashes 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
12 breaking4 security10 performance5 behavior and defaults1 tooling7 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@noble/hashes 239 changes
Breaking changes 12
Fails until entropy is added.
blake2.compress was renamed to _compress and marked internal.
No longer returns a value, improving performance.
The internal crypto module is removed; use built-in WebCrypto instead.
The package is now ESM-only; ESM can be loaded from CommonJS on Node v20.19+.
Hash inputs now accept only Uint8Array; string inputs are prohibited. Use utils.utf8ToBytes to replicate the previous behavior.
Use the .js extension when importing modules, for example @noble/hashes/sha3.js instead of @noble/hashes/sha3.
The blake2b and blake2s modules are renamed to blake2.js; update imports to the new module path.
The ripemd160, sha1, and md5 modules are moved to legacy.js; update imports to the new module path.
The sha256 and sha512 modules are renamed to sha2.js; update imports to the new module path.
The _assert module is renamed to utils.js; update imports to the new module path.
Node v20.19 is now the minimum required version.
Security 4
Use rejection cleanup to wipe work state if scheduling is aborted.
Passed options are protected against mutation and pollution.
Rejects output sizes that caused the engine to crash.
Improves zeroization.
Performance 10
Argon2 is 20% faster.
Argon performance improves by 2.2x.
32-bit inputs are 10–45% faster across all hashes.
kmac is 20% faster.
1 MB inputs are 50% faster for KT128, KT256, and TurboSHAKE.
pbkdf2 and hkdf are 20% faster.
SHA-3 and SHAKE are 40% faster.
Runs up to 50% faster.
Improved tree-shaking reduces bundle sizes.
The package is smaller than v1.x, reducing npm download and unpacked sizes.
Behavior and default changes 5
Cost options are optional, with defaults t: 3, m: 1024 ** 2 KiB, p: 1, and dkLen: 32; calls using more memory must set maxmem explicitly, whose default limit is 1 GiB.
Yields through scheduler.yield() when available or setTimeout otherwise, allowing timers, I/O, and rendering to progress; accepts optional rejection cleanup.
Corrects the default maxmem to work with N: 2 ** 20, r: 8, and p: 1.
Error messages are improved and type checks are stricter throughout the library.
Error messages are more descriptive.
Tooling 1
TypeScript types and option autocomplete are improved.
Fixes and other changes 7
Fixes tree merging for multi-terabyte streams.
HMAC _cloneInto now preserves canXOF.
The package is now Big Endian friendly, with tests passing on s390x.
Fixes behavior when blockLen=0.
Fixes handling of dkLen=0.
Fixes compilation issues on TypeScript v6.
Byte Array types are fixed for compatibility with TypeScript 5.6 and TypeScript 5.9+.