- Add
etefunction for entropy transform effeciency calc - Add numerous character sets
- No runtime/library code changes in this release
- Enable npm provenance by publishing from GitHub Actions with OIDC
- Add release workflow to publish on tag pushes (Yarn install/test, npm publish --provenance)
- No code changes vs 2.1.0
-
Add
encode(bytes)anddecode(puid)methods on the Puid generator to encode/decode using the generator's configured characters. -
Add
risk(total)andtotal(risk)methods on the Puid generator to approximate the risk/total for the generator using conservative approximations of actual entropy capacity.
- Extend Puid type with encode and decode methods
- Extend Puid type with risk and total methods
The calculations using bits, risk and total drop the minor efficiency for small totals. When using total < 1000 this may create a slightly different corresponding value for a calculation given any two of the three values, but does not effect core puid generation.
- Raise Node.js engines requirement to >=18
- Introduce exports map and ESM/browser export conditions; deep imports may break depending on consumers' bundlers/resolvers
- New browser-friendly entry point (
import { puid } from 'puid-js/web') - Add
generate(config?)convenience function
- Browser-safe ERE computation via new
byteLengthhelper (uses TextEncoder in browsers) - Correct ESM
.mjsand browser export conditions
- Reduce allocations on the power-of-two path in
bitsby replacing map with a preallocated loop - Cache
bitShiftsper charset to avoid recomputation
- Narrow
EntropyFunctionto a discriminated union and remove casts infillEntropy - Improve Web Crypto detection and binding
- Freeze
puid.infofor safer consumption
- Pin Yarn 4.9.4 and add CI/release workflows
- Raise TypeScript targets, enable strict typing, add subpath exports and npm metadata
- Add tinybench micro-benchmark and Node ESM consumer example
- Documentation: add "Migrating from UUID v4" section
- Encoders for char sets added in 1.3.0 were defaulting to the basic custom chars encoder rather than optimized versions.
- Further optimize bit shifts
- Change order of Base32 characters to match RFC 4648
- Add more PUID cross-repo data tests
- Add predefined characters
- Base16 from RFC 4648
- Crockford32
- WordSafe32
Note: Base16 chars are the same as HexUpper. If HexUpper chars are used, Puid info will report the name as base16.
- Reject chars with ASCII range code point between tilde and inverted bang
- Reject unicode chars with code point beyond 0xFFFF
- Bound all encoders to report NaN if called to encode an number outside the range of specified characters. The
encodecall is meant to be internal and this change should not affect external code.
- General code cleanup
- Selection of bit shift. This effected the histogram of some characters sets.
- Reordered alphanum lower and upper characters (digit last to match other PUID libraries)
- Tests for AlphaNumLower & AlphaNumUpper
- Cross puid repo data submodule
- Test of cross puid data. This functions as puid histogram testing since cross repo data has been validated using chi-square tests.
- Chars.SafeAscii encoder
- Simplified bit shift calc
- Reordered alphanum lower and upper characters (digit are first)
- Optimized sliced values to puid string processing
- Chars.Symbol and encoder
- Encoders for Chars.AlphanumLower and Chars.AlphanumUpper
- Test for above fixes, changes and additions
- Update README
- Update npm package keywords
- Remove spurious dependency on @bitauth/libauth
Initial release