Repository navigation
Releases
[email protected]
Minor Changes
-
1e0b85f: fix: correct stale comments and contracts that contradicted the code
nanoid(0)andnanoid({ length: 0 })returned an empty string while the JSDoc
advertised@throws Length must be between 0 and 2048and the CLI documented a
1-256range. Length is now validated as an integer in1..2048with a single
LENGTH_OUT_OF_RANGEmessage.nanoid.isValid()cannot check a generated length, because a nanoid carries none.
Its JSDoc and reference page now say so instead of leaving the gap implicit.nanoidnow readsglobalThis.cryptolike every other module, instead of the bare
cryptoglobal.encodeBase62andencodeObjectIdHexaccepted inputs longer than the canonical
length and silently encoded only the leading bytes. They now require the exact
length, matching the publicfromBytes()wrappers.docs/STABILITY.mddescribed the ObjectID and XID counters as "always-incrementing".
Both are 24-bit counters that wrap to zero after 2^24 values in the same second.- Corrected the
incrementBytesInPlacecomment, which credited KSUID with a call
KSUID never makes, and theobjectid/hex.tsdecoding-table comment, which reported
128 KiB for a 64 KiB allocation.
-
1e0b85f: fix(ulid): advance virtual time when the monotonic random portion overflows
ULID handled exhaustion of its 80-bit monotonic random portion by filling the
remaining random bytes with0xffand throwingRANDOM_OVERFLOW, which left the
generator failing for every later call in that millisecond. UUID v7 handled the
same situation by advancing its timestamp by one millisecond.There is now one policy: both generators advance virtual time by one millisecond
and continue from a zeroed counter, so subsequent calls stay unique and
monotonic instead of throwing.Neither generator guards that advance against the end of the 48-bit timestamp
field, which was a latent bug in both: at the maximum millisecond, uuidv7 wrote a
timestamp that silently wrapped to zero, and ULID emitted a string its own
isValid()rejects (or, through the buffer path, also wrapped the timestamp).
Both now saturate and throwTIMESTAMP_OUT_OF_RANGEinstead of emitting an ID
whose timestamp field overflowed.RANDOM_OVERFLOWwas unreachable in practice (1 in 2^80 per millisecond) and is
removed fromERROR_CODES. This is a pre-1.0 breaking change to the error
catalog:ERROR_CODESno longer contains it, and the
ULID_RANDOM_OVERFLOW→RANDOM_OVERFLOWrow is gone from the v1 migration
guide. -
1e0b85f: fix(uuid): make
uuidv7.timestamp()reject values that are not UUID v7uuidv7.timestamp()parsed its argument with the version-agnostic byte codec, so
passing a UUID v4 or v5 returned the first six random bytes as a plausible-looking
creation time. It now requires the RFC 9562 version 7 and10xxvariant bits, and
throwsInvalidInputErrorwith codeUUID_NOT_V7otherwise, matching
typeid.timestamp(). TheNILandMAXsentinels keep working, since RFC 9562
defines them without a version.UUID_NOT_V7now reports bothuuidandtypeidas strategies.The shared
isUuidVersion7andisNilOrMaxBytespredicates live in
uuid/common/uuid.tsso the UUID and TypeID readers cannot drift apart again.toBytes()is unchanged and still accepts any 128-bit UUID form, the way
uuid.parse()does: it is a byte codec, not a version guard. Its JSDoc now says so
explicitly, becauseisValid()is version-specific.
Patch Changes
-
128402c: fix(uuid): let
uniku/uuid/v4load in insecure browser contextsCrypto.randomUUIDis available only in secure contexts, while
Crypto.getRandomValuesis not. The module captured
globalThis.crypto.randomUUID.bind(...)at module scope, so importing
uniku/uuid/v4over plainhttp://on a non-localhost origin threw
TypeError: Cannot read properties of undefined (reading 'bind')during module
evaluation. That also took downtoBytes,fromBytes, andisValid, which do
not touch randomness at all.The no-argument generator now uses
crypto.randomUUID()when the runtime
provides it and otherwise falls back to the shared CSPRNG pool plus the local
formatter, so the entry point works on any origin. -
1e0b85f: docs(bench): report benchmark dispersion and stop overstating ratios
The performance guide published ratios to two significant figures without any
measure of uncertainty, which implied a precision the harness does not have. Two
runs of the same command on one machine move the small-ratio rows by up to 22%,
and a different machine moves the ULID row from 163x to about 85x.bench-summarynow prints aSpreadcolumn computed from each row's
withinActionRme/crossActionRme, and labels a rowparity (within spread)
when its deviation from 1x is smaller than the ratio's combined dispersion.
Snapshots without multi-run data show—instead of a fabricated number.bench-results.tsgainsbenchmarkDispersion,combineDispersion, and
isRatioWithinDispersion. Dispersion prefers multi-run figures over a single
run's RME and combines in quadrature; the parity band is multiplicative
(1 / (1 + s)to1 + s), because a relative dispersion scales with the value it
describes. A symmetric absolute band would call0.75xparity while calling its
reciprocal1.33xfaster, and at 100% spread it would call even0.001xparity.- The performance guide reports ranges rounded to about one significant figure and
states what each row does and does not compare. In particular the UUID v4 row
compares the same native primitive behind two different wrappers — uniku's cached
bound function against[email protected]re-readingcrypto.randomUUIDon every call
— so it measures wrapper overhead, not generation speed, and it is the row that
moved most between runs. The ULID row is qualified on both sides: the reference
re-detects its PRNG and draws 16 single bytes per call, while uniku draws once per
millisecond and increments the existing tail. Provenance of the range endpoints is
spelled out, including which ones are not published artefacts.
uniku CLI v0.9.1
What's Changed
- fix(uuid): load uniku/uuid/v4 without a secure context by @jkomyno in #116
- chore: land PRs #117-#120 on main (stacked merges went into their base branches) by @jkomyno in #123
- docs(readme): list uniku/uuid/v7 in the no-barrel-exports block by @jkomyno in #122
- chore(release): version packages by @github-actions[bot] in #121
Full Changelog: https://github.com/jkomyno/uniku/compare/@uniku/[email protected]
@uniku/[email protected]
[email protected]
Minor Changes
- 09421e3: Require Node.js 22.12.0 or newer. Node.js 20 is no longer supported; CI covers the Node.js 22 minimum, Node.js 24 LTS, and Node.js 25.
Patch Changes
- 5b6ad76: Preserve TSID sequencing when configuring node, nodeBits, or epoch. Configured calls and empty options now retain the per-isolate counter, handle clock rollback, and advance virtual time on counter overflow instead of sampling counters independently. Explicit timestamps and counters continue to bypass shared state.
uniku CLI v0.9.0
What's Changed
- chore(deps): refresh ID references and require Node.js 22 by @jkomyno in #110
- fix(tsid): preserve sequencing for configured generation by @jkomyno in #111
- fix(cli): reject malformed IDs and preserve TSID batch sequencing by @jkomyno in #112
- docs(perf): refresh benchmarks for current reference libraries by @jkomyno in #115
- chore(release): version packages by @github-actions[bot] in #114
Full Changelog: https://github.com/jkomyno/uniku/compare/@uniku/[email protected]
@uniku/[email protected]
Minor Changes
- 09421e3: Require Node.js 22.12.0 or newer. Node.js 20 is no longer supported; CI covers the Node.js 22 minimum, Node.js 24 LTS, and Node.js 25.
Patch Changes
- b223237: Validate explicitly selected ID formats before inspection and report malformed IDs as structured failures on stderr, including with --json. Use the library's stateful TSID generation for configured nodes, and retain one node identity within fixed-timestamp batches.
- Updated dependencies [09421e3]
- Updated dependencies [5b6ad76]
[email protected]
Minor Changes
- a7ace05: Add
uniku/uuid/v5, a name-based UUID (RFC 9562 section 5.5) that derives the same ID from the same name and namespace in every process and runtime. It is synchronous and dependency-free, follows theuuidpackage's(name, namespace, buf?, offset?)argument order, and addsuuidv5.namespace()to parse a namespace once, plus theDNS,URL,OID, andX500namespace constants. - 379c872:
typeid.fromUuid(),typeid.fromBytes(),typeid.toUuid(),typeid.toBytes(),typeid.prefix(),typeid.suffix(), andtypeid.isValid()now accept a TypeID or UUID of any version, as the TypeID specification recommends, sotypeid.fromUuid('tool', uuidv5(name, namespace))gives a deterministic TypeID.typeid()still generates UUID v7.typeid.timestamp()is now the only function that throwsUUID_NOT_V7, for a TypeID that does not wrap a UUID v7.typeid.fromUuid()with a string that is not a UUID now throws aParseError(INVALID_LENGTH,INVALID_FORMAT, orINVALID_CHAR) instead ofUUID_NOT_V7.
uniku CLI v0.8.0
What's Changed
- feat(uniku): derive stable IDs with name-based uuid/v5 by @jkomyno in #106
- build(cli): run on stable Effect 4.1.3 by @jkomyno in #109
- chore(release): version packages by @github-actions[bot] in #108
Full Changelog: https://github.com/jkomyno/uniku/compare/[email protected]
@uniku/[email protected]
Minor Changes
-
7c9c85b: Run on stable Effect 4.1.3 instead of the
4.0.0-beta.93pin, which removes the direct@effect/platform-node-sharedpin that worked around thenpm i -gstartup crash.Command-line parsing is stricter. Each of these used to be ignored and now fails with exit code 1 and the command's help:
- a single-value flag passed twice, such as
uniku uuid -n 2 -n 3; - an extra positional argument, such as
uniku uuid extra; - a flag with a missing value, such as
uniku uuid -v.
An invalid
--log-levelvalue now also shows the command's help with the error.Negative numbers are read as flag values, so
uniku tsid --node -1reports an invalid node instead of an unknown-1flag, and a negative--countis rejected as an invalid value.--completionsalso acceptspowershellandpwsh, and parse errors are worded more plainly. - a single-value flag passed twice, such as
Patch Changes
- 343f72d: Add
uniku uuid -v 5 --namespace <dns|url|oid|x500|uuid> --name <value>for name-based UUIDs.uniku inspectanduniku validatenow recognize UUID v5 IDs, which were misdetected as Nanoid, and report the UUID version a TypeID wraps instead of assuming v7. Fix the startup crash afternpm i -g @uniku/cli(ERR_MODULE_NOT_FOUNDforeffect/dist/process/ChildProcess.js). - Updated dependencies [a7ace05]
- Updated dependencies [379c872]
[email protected]
Patch Changes
- Include the
0.7.0changes:uniku/uuid/v5and TypeID conversions that accept a UUID of any version. - Remove the deprecated
secs,seq, and Nanoid object-formsizealiases after their final migration release in0.6.0. Usemsecs,counter, andlengthinstead.CONFLICTING_OPTIONSis also removed from the v1 error-code catalog because no supported option pair conflicts after these aliases are gone.