You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48-22Lines changed: 48 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
6
6
# bytecodec
7
7
8
-
Typed JavaScript and TypeScript byte utilities for base64, base64url, UTF-8 strings, JSON, gzip, concatenation, comparison, and byte-source normalization. The package ships tree-shakeable ESM plus CommonJS entry points and keeps the same API across Node, Bun, Deno, browsers, and edge runtimes.
8
+
Typed JavaScript and TypeScript byte utilities for base64, base64url, hex, Z85, UTF-8 strings, JSON, gzip, concatenation, comparison, and byte-source normalization. The package ships tree-shakeable ESM plus CommonJS entry points and keeps the same API across Node, Bun, Deno, browsers, and edge runtimes.
9
9
10
10
## Compatibility
11
11
@@ -17,7 +17,7 @@ Typed JavaScript and TypeScript byte utilities for base64, base64url, UTF-8 stri
17
17
18
18
## Goals
19
19
20
-
- Developer-friendly API for base64, base64url, UTF-8, JSON, gzip, concat, equality, and byte normalization.
20
+
- Developer-friendly API for base64, base64url, hex, Z85, UTF-8, JSON, gzip, concat, equality, and byte normalization.
21
21
- No runtime dependencies or bundler shims.
22
22
- Tree-shakeable ESM by default with CommonJS compatibility and no side effects.
23
23
- Returns copies for safety when normalizing inputs.
Z85 encodes 4 input bytes into 5 output characters, so `toZ85String()` requires a byte length divisible by 4 and `fromZ85String()` requires a string length divisible by 5.
Validation failures throw `BytecodecError` instances with a `code` string, for example `BASE64URL_INVALID_LENGTH`, `BASE64_DECODER_UNAVAILABLE`, `UTF8_DECODER_UNAVAILABLE`, and `GZIP_COMPRESSION_UNAVAILABLE`. Messages are prefixed with `{@sovereignbase/bytecodec}`.
187
+
Validation failures throw `BytecodecError` instances with a `code` string, for example `BASE64URL_INVALID_LENGTH`, `HEX_INVALID_CHARACTER`, `Z85_INVALID_BLOCK`, `BASE64_DECODER_UNAVAILABLE`, `UTF8_DECODER_UNAVAILABLE`, and `GZIP_COMPRESSION_UNAVAILABLE`. Messages are prefixed with `{@sovereignbase/bytecodec}`.
166
188
167
189
### Safety / copying semantics
168
190
@@ -172,8 +194,8 @@ Validation failures throw `BytecodecError` instances with a `code` string, for e
172
194
173
195
`npm test` covers:
174
196
175
-
-53 unit tests
176
-
-4 integration tests
197
+
-68 unit tests
198
+
-6 integration tests
177
199
- Node E2E: ESM and CommonJS
178
200
- Bun E2E: ESM and CommonJS
179
201
- Deno E2E: ESM
@@ -183,26 +205,30 @@ Validation failures throw `BytecodecError` instances with a `code` string, for e
183
205
184
206
## Benchmarks
185
207
186
-
Latest local `npm run bench` run on 2026-03-19 with Node `v22.14.0 (win32 x64)`:
208
+
Latest local `npm run bench` run on 2026-03-23 with Node `v22.14.0 (win32 x64)`:
0 commit comments