tobogganSe connecter

louise

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

Packages: uuid text forms 17x faster (issue #303)

A Crockford decode + encode round trip took 32.8 µs in a release build;
it now takes about 1.9 µs (same compiler, packages/uuid/bench).

- Presets carry their width and bits per digit, and case folding
  replaces the 22 computed lowercase aliases: `crockford()` costs ~50 ns,
  not 10 µs, so calling it per use is fine.
- Alphabets of 2^k characters (hex, Crockford, and custom ones of 2 to 64
  characters) are read and written k bits at a time in small Ints, with
  plain arithmetic: std/int's bit operations are calls into the runtime.
  No 128-bit Int, no `power`.
- A character's digit is found by halves (alphabets are ascending), not
  by a linear search and a fold over the aliases.
- Base 58 and 62 keep the 128-bit path, without `power`: 28 -> 16 µs.
- An invalid character is still reported before a value too large.

Tests: the presets agree with `alphabet` on the same characters, and
power-of-two alphabets of 4, 8 and 64 characters (whose first digit holds
padding) match a model. bench/ measures each form; the README gives the
costs.

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

olivier · il y a 1 mois · b8fc2ed011c76011c08174163308be086f351dcb

Parents 8b9ba8c

5 fichiers modifiés, 448 ajouts, 87 suppressions