tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

Packages: uuid, version 7 IDs and text forms that sort like them (issue #141)

`packages/uuid`, in pure Louise:
- `Uuid` (opaque, 16 bytes; Eq, Ord and Hash by bytes), `from_bytes`,
  `to_bytes`, `nil`, `max`.
- `v7()` reads `clock` and `random` (ADR 0036); `v7_from(unix_ms,
  randomness)` follows RFC 9562 section 5.7. Within a millisecond the
  order is random. `version`, `timestamp`.
- `to_rfc`/`from_rfc`: the 36-character form, any case on input.
- `encode`/`decode` with an alphabet: `crockford()` (the default, used by
  `show`; reads lowercase and I, L, O as Crockford says), `hex()`,
  `base58()`, `base62()`, or `alphabet(chars)`, which must be URL-safe,
  without repeats and ascending, so text sorts like the IDs.

Tests: RFC 9562's A.6 vector, every preset's width and encodings
(computed separately with Python's uuid module), round trips, each
refusal, ordering of text and IDs, and a deterministic `v7()` under a
fixed clock and seed. CI runs them in the interpreter and natively.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 1 mois · 5ca4e959db07770c040b367bffca6de920454d15

Parents ef4aa2e

5 fichiers modifiés, 636 ajouts, 0 suppressions