Say what the objectid category actually is, and re-flow the registry comment

This commit is contained in:
Mikael Göransson
2026-08-27 23:50:23 +02:00
committed by lilleman-tw
parent 43d3a752b3
commit e371d217f4
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -178,9 +178,9 @@ Swedish personnummer): `address`, `color`, `company`, `date`, `email`, `ip`,
`data/misc` carries locale-neutral categories — universal data that isn't tied to
a language or region:
- ids & networking: `uuid` (a proper random v4), `mac`, `objectid` (MongoDB
ObjectID, 24 hex chars), `creditcard` (per-network numbers ending in a valid
`{luhn()}` digit)
- ids & networking: `uuid` (a proper random v4), `mac`, `objectid` (24 hex chars,
MongoDB ObjectID-shaped — the leading bytes are random, not a real timestamp),
`creditcard` (per-network numbers ending in a valid `{luhn()}` digit)
- reference codes: `currency` (ISO 4217), `country` (ISO 3166), `language` (ISO
639), `timezone` (IANA)
- web & systems: `mimetype`, `httpstatus`, `useragent`
+3 -3
View File
@@ -20,9 +20,9 @@ const (
// the digits emitted so far in the current expansion (luhn, mod11, ean — place
// them after their payload); generators read only the rng (uuid, ulid, ...). All
// must stay pure over (rng, emitted, args) so a seeded faker is reproducible — a
// time-based id (uuid v7, ulid) draws its timestamp from the rng, not
// the wall clock. Add a builtin only for what data can't express: a random v4
// UUID already ships as data (data/misc/uuid.json), so the builtin is v7.
// time-based id (uuid v7, ulid) draws its timestamp from the rng, not the wall
// clock. Add a builtin only for what data can't express: a random v4 UUID and a
// 24-hex ObjectID both ship as data, so the uuid builtin is v7.
var builtins = map[string]builtin{
"luhn": {arity: 0, call: func(_ *session, e string, _ map[string]node, _ []string) string {
return string(rune('0' + luhnCheck(e)))