Repository navigation
v1.1.0
NumBase 1.1.0 simplifies conversion by fixing each instance's alphabet at construction. Alphabet validation, digit lookup construction, and native radix-formatting eligibility now run once, rather than during repeated conversions.
Configuration notice
BASE is now a frozen readonly array and MAX_BASE is its fixed length. Versions 0.x and 1.0.0 allowed these properties to be changed; assignments are no longer supported. Create a new instance to change alphabets, or pass a radix per operation. Read access remains available.
Valid encoded output, the default Base62 order (0–9, a–z, A–Z), Unicode options, precision validation, and the no-BigInt fallback remain unchanged. README examples now use modern imports.
Validation and performance
- All 33 Vitest tests pass with 100% statements, branches, functions, and lines; Node 22/24 CI passes.
- An additional 720 seeded values match published 1.0.0 across custom alphabets and radices.
- TypeScript consumer checks and packed CommonJS/ESM installation pass.
- Minified output shrinks from 4,961 to 4,162 bytes; gzip from 1,952 to 1,707 bytes. Zero runtime dependencies.
- Local Node 24 benchmarks show about 2x faster 64-bit ID decoding and 5.8x faster decoding with a 4,096-symbol alphabet when instances are reused. Long Base62 conversion is broadly similar. Default construction costs about 2 additional microseconds; batch usage should reuse instances. Results depend on workload and engine.
See the migration guide and changelog.
Install with pnpm add numbase@1.1.0 or npm install numbase@1.1.0.