feat(identifier): add std/identifier with Uuid and Ulid #423
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/122-std-identifier"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task
Implement
std/identifierwithUuidandUlid(torbscript/language#122), per the decisions recorded on the issue.What
std/identifier: the traitIdentifier,IdentifierError,Uuid(RFC 9562 versions 4 and 7) andUlid(monotonic mode throughafter).Randomand the clock aTimestamp, both arguments: the package has no capability.Timestampreplaces theInstantof the earlier URI.md draft; a time before 1970 panics (documented under# Panics).uint64()draws of the SplitMix64 generator; the tests pin it with known answers computed independently.Uuidhas one conversion pair (String); theurn:uuid:bridge (Uri.from(uuid),Uuid.tryFrom(urn)) lives instd/identifier, notstd/uri. JSON round trip is tested.docs/standard-library/identifier.md,docs/design/URI.mdsection 12 and slice 11,FIRST-PARTY.mdgap 13,RANDOM.md,ROADMAP.md, the standard-library index;skills/regenerated.Test
std/identifier/tests/identifier.test.trb(known-answer vectors, RFC 9562 and ULID examples, carry, ordering, hash andMapkey, JSON,urn:uuid:) pass on a prebuilt nightlytorb.torb format --check std/identifier,torb docs source std/identifierand--panics,torb docs check docs --no-native,docs index/declarations/skill --check,tools/check-commits.sh.extend Uri with From<Uuid>.Closes #122
Approved. Checklist against #122 (acceptance criteria 1-9):
Non-blocking:
# Panicsbut not covered by a test (the issue allows this when std/test has no panic assertion); add one if/when it does.