Say what the objectid category actually is, and re-flow the registry comment
This commit is contained in:
committed by
lilleman-tw
parent
43d3a752b3
commit
e371d217f4
@@ -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
|
`data/misc` carries locale-neutral categories — universal data that isn't tied to
|
||||||
a language or region:
|
a language or region:
|
||||||
|
|
||||||
- ids & networking: `uuid` (a proper random v4), `mac`, `objectid` (MongoDB
|
- ids & networking: `uuid` (a proper random v4), `mac`, `objectid` (24 hex chars,
|
||||||
ObjectID, 24 hex chars), `creditcard` (per-network numbers ending in a valid
|
MongoDB ObjectID-shaped — the leading bytes are random, not a real timestamp),
|
||||||
`{luhn()}` digit)
|
`creditcard` (per-network numbers ending in a valid `{luhn()}` digit)
|
||||||
- reference codes: `currency` (ISO 4217), `country` (ISO 3166), `language` (ISO
|
- reference codes: `currency` (ISO 4217), `country` (ISO 3166), `language` (ISO
|
||||||
639), `timezone` (IANA)
|
639), `timezone` (IANA)
|
||||||
- web & systems: `mimetype`, `httpstatus`, `useragent`
|
- web & systems: `mimetype`, `httpstatus`, `useragent`
|
||||||
|
|||||||
+3
-3
@@ -20,9 +20,9 @@ const (
|
|||||||
// the digits emitted so far in the current expansion (luhn, mod11, ean — place
|
// 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
|
// 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
|
// 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
|
// time-based id (uuid v7, ulid) draws its timestamp from the rng, not the wall
|
||||||
// the wall clock. Add a builtin only for what data can't express: a random v4
|
// clock. Add a builtin only for what data can't express: a random v4 UUID and a
|
||||||
// UUID already ships as data (data/misc/uuid.json), so the builtin is v7.
|
// 24-hex ObjectID both ship as data, so the uuid builtin is v7.
|
||||||
var builtins = map[string]builtin{
|
var builtins = map[string]builtin{
|
||||||
"luhn": {arity: 0, call: func(_ *session, e string, _ map[string]node, _ []string) string {
|
"luhn": {arity: 0, call: func(_ *session, e string, _ map[string]node, _ []string) string {
|
||||||
return string(rune('0' + luhnCheck(e)))
|
return string(rune('0' + luhnCheck(e)))
|
||||||
|
|||||||
Reference in New Issue
Block a user