@exodus/bytes
1.16.0 · 22 Sep 2026MIT78.5M / weekRepositorynpmAtom feed
20 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
1.16.0
22 Sep 2026crc32
What's Changed
crc32
Added
import { crc32 } from '@exodus/bytes/crc.js'.It's fast.
Native under
"node"import condition, polyfilled everywhere else.1.15.2
21 Sep 2026fromHex on Node.js validation in 47fc52c
Node.js 25+ is not affected.
Browsers and other non-
"node"import conditions are not affected.
What's Changed
fromHex on Node.js validation in 47fc52c
This fixes a bug in
fromHexvalidation behavior on Node.js 24.x and below.Affected are platforms resolving to
"node"import condition that do not have nativeUint8Array.fromHex.Node.js 25+ is not affected.
Browsers and other non-
"node"import conditions are not affected.Valid input is not affected.
On affected platforms, fromHex failed to reject some invalid strings:
% node Welcome to Node.js v24.21.0. Type ".help" for more information. > require('@exodus/bytes/hex.js').fromHex('\u0041\u0042') // correct, this is 'AB' Uint8Array(1) [ 171 ] > require('@exodus/bytes/hex.js').fromHex('\u0141\uFF42') // incorrect, high byte in input symbols is coerced Uint8Array(1) [ 171 ]This is now fixed.
1.15.1
20 May 2026Don't use bigint literals
1.15.0
4 Mar 2026isomorphicDecode(),isomorphicEncode()in/encoding.js(in #68)fromBase32crockford/toBase32crockfordin/base32.jstypedCopyBytes()in/array.js
isomorphicDecode(),isomorphicEncode()in/encoding.js(in #68)fromBase32crockford/toBase32crockfordin/base32.jstypedCopyBytes()in/array.jsAdd
'arraybuffer'output format support in methods acceptingformatparameter (in #70)'uint8'(default) output format now never returns pooledUint8Arrayinstances (see below)
This release brings support of native ArrayBuffer return format (under the name of
format: 'arraybuffer').Converting
Uint8ArraytoArrayBufferdownstream is non-trivial, and there is a lot of confusion in the ecosystem around those.
A simple access to.bufferis often seen and is incorrect -- code accepting Uint8Arrays that it didn't create should not assume that it did not receive for example a result of.subarray()(where.buffersize mismatches the view size), or a Node.js pooledBufferinstance (which are also Uint8Arrays).That pattern (using
.bufferand failing to check bounds) has been a source of numerous errors in ecosystem libraries.To minimize the risks from such mistakes, this library now never returns
Uint8Arrayinstances (default format) that are not complete views of their underlyingArrayBuffer.In other words, now the following are true for a returned Uint8Array instance
u8:u8.buffer.byteLength === u8.byteLengthu8.byteOffset === 0deepStrictEqual(new Uint8Array(u8.buffer), u8)
The affected parts (which previously returned non-complete views / subarrays) are:
On multiple platforms:
fromBase58Check,createMultibyteEncoder,createSinglebyteEncoderOn Node.js import condition only (any Node.js version):
latin1fromString,utf8fromString,utf16fromStringOn Node.js import condition with Node.js < 25:
fromHex,fromBase64
This comes at a reasonable performance cost (almost exclusively on Node.js import condition), but correctness/security comes first.
Note
This change doesn't affect
TextEncoder, which is already governed by the Encoding Standard which demands non-pooled Uint8Arrays.This also doesn't affect
typedView()(from/array.js) which by definition is always a view of the same underlyingArrayBufferdata.
But nowtypedCopyBytes()is introduced.Important
This change does not affect
'buffer'return format, which can still return pooledBufferinstances.
This is similar to the behavior of nativeBuffer.from/Buffer.allocwhich are pooled.Apart from making returned Uint8Array instances complete views, a dedicated ArrayBuffer return format is introduced to eliminate the need to use
.bufferon the returned values in downstream code at all (as it's a bad pattern in general and tooling/lint will/should flag that).1.14.1
13 Feb 2026fix: ensure TextEncoder never returns pooled arrays
fix: ensure TextEncoder never returns pooled arrays
Previous implementation always ensured 0-offset Uint8Array (
ret.byteOffset === 0),
but not that there is no data past the returned view (ret.byteLength === ret.buffer.byteLength).This is now fixed.
This only affected Node.js-like platforms, as only there native buffers are pooled.
1.14.0
12 Feb 2026Fix
makeBase58check()Typescript typesAdd
sideEffectsconfigurationOnly
@exodus/bytes/encoding.jsexport has side-effects, and those side-effects are internal:It is documented to load multi-byte codecs for both this import and future (and previous)
/encoding-lite.jsimports, even if the current import does not use the provided TextDecoder.Both
/encoding.jsand/encoding-lite.jsare designed to return the exact same TextDecoder class and methods, and loading full implementation provides multi-byte encodings support everywhere.As
/encoding-lite.jscan be used as a global polyfill, the setup has to avoid polyfill conflicts if something loads/encoding.jsand then something else replaces it with/encoding-lite.js(or vice versa)The same mechanism is reused to keep
/whatwg.jsminimal by default, and only support multi-byte encodings if/encoding.jswas imported and loaded them at any point.This is not a new change, just documenting the existing behavior and exposing
sideEffectsconfiguration so that bundlers can optmize out other imports.Further bundle size optimizations
1.13.0
11 Feb 2026Bundle size reductions, especially for browsers
Under
browsermodule resolution target, we rely on browsers to have a working UTF-8 / UTF-16 / windows-1252 (latin1 subset)TextDecoderimplementation that doesn't have bugs when used without streaming and withignoreBOM: true, and aTextEncoderWhile browsers have bugs even in UTF-8, those bugs are related to streams and/or BOM processing, and that specific combination we use seems to be always robust.
In previous versions we already used native codepaths for those where possible and operated under the same assumption.
Disable hex/base64 performance optimization for Firefox >=133 <146
We used a guarded useragent check for those versions to prefer js fallback instead of native base64 / hex implementations, as native was slow before FF 146 (ref: bugzilla.mozilla.org/show_bug.cgi and linked issues)
As the usage of FF <146 diminished according to caniuse stats, this check is not worth it anymore.
This version removes that useragent check.
Those Firefox versions are still supported by the library, but now the native base64 / hex implementation is always used when available.
See 8cab29a for implementation details.
1.11.0
1 Feb 2026Add
/whatwg.jsandpercentEncodeAfterEncoding()utf16toStringLoose(Uint16Array)on Big-Endian hardware
What's Changed
Add
/whatwg.jsandpercentEncodeAfterEncoding()utf16toStringLoose(Uint16Array)on Big-Endian hardware
1.10.0
26 Jan 20261.9.0
18 Jan 2026Implement strict multi-byte encoders, except for
iso-2022-jpfor nowAdd
/encoding-browser.jsto load only native lightweight TextDecoder/TextEncoder in browser bundlesAdd
/index.jsexport with usage warning, mostly for IDEs
Implement strict multi-byte encoders, except for
iso-2022-jpfor nowAdd
/encoding-browser.jsto load only native lightweight TextDecoder/TextEncoder in browser bundlesAdd
/index.jsexport with usage warning, mostly for IDEsSwitch
/base58check.jspeer dep (used on non-Node.js platforms) to@noble/hashesdirectly (previously@exodus/crypto)Fix
legacyHookDecode()behavior on non-even (incomplete) UTF-16 byte lengthFix
utf16toString(uint16arr)on Big-Endian Node.jsPerformance improvements in encoders and decoders
1.8.0
2 Jan 2026Support
iso-8859-1,iso-8859-9,iso-8859-11encodings insingle-byte.jslatin1fromString,latin1toStringTypes for
encoding.js
What's Changed
Support
iso-8859-1,iso-8859-9,iso-8859-11encodings insingle-byte.jslatin1fromString,latin1toStringTypes for
encoding.jsTypes for
encoding-lite.jsPerf improvements for encodings
1.7.0
28 Dec 2025Implement
TextDecoderStream/TextEncoderStream
Requires Streams to be either supported by the platform or polyfilledImplement
createSinglebyteEncoder(only fatal mode for now)Fix a missing check for non-Latin1 chars in
fromBech32/fromBech32mon non-Hermes barebone engines
Node.js, browsers, other non-barebones and Hermes / React Native were not affected
What's Changed
Features
Implement
TextDecoderStream/TextEncoderStream
Requires Streams to be either supported by the platform or polyfilledImplement
createSinglebyteEncoder(only fatal mode for now)
Fixes
Fix a missing check for non-Latin1 chars in
fromBech32/fromBech32mon non-Hermes barebone engines
Node.js, browsers, other non-barebones and Hermes / React Native were not affectedPassing detached
ArrayBufferinstances toTextDecodershould return empty strings, not throw
1.6.0
25 Dec 2025TextDecoder performance improvements for non-Unicode encodings.
1.5.0
24 Dec 2025Support cross-context
Uint8Arrayinstances innew TextEncoder().encodeInto(...)Faster legacy multi-byte decoders
1.4.0
24 Dec 2025Add support for cross-context
ArrayBufferin TextDecoder/wif.jsnow does not need@exodus/cryptopeer dependency when used on Node.js
1.3.0
23 Dec 2025Add
labelToName(label)in/encoding.jsand/encoding-lite.js/base58check.jsnow does not need@exodus/cryptopeer dependency when used on Node.js
1.2.0
22 Dec 2025Add support for Node.js builds without ICU in
/utf-8.jsandTextDecoderimplementation.
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.