Sourced from github.com/brianvoe/gofakeit/v7's releases.
ID Generator
New:
ID()— Fast, Human-Readable Random Identifier(GoFakeIt v7.9.0)
gofakeit.ID()is a new high-performance identifier generator designed for speed, readability, and practically zero collision probability.Unlike UUID v4 or XID, this generator is intentionally random-first, not structure-based.
Perfect for mock APIs, test data, fixtures, seed data, and temporary identifiers.
Highlights
- Human readable alphabet, no confusing characters
→23456789abcdefghjkmnpqrstuvwxyz(no 1, l, i or 0, o to alleviate confusion)- Fast
- Memory Allocation
- Generates from your rand source
- Shorter than UUID, faster than XID, and requires no coordination
Example
id := gofakeit.ID() fmt.Println(id) // → "3t9qf4c92npxhw7bg6y0"
Performance Benchmarks
Measured on Go 1.25
Generator / Function Benchmark Name ops/sec ns/op B/op allocs/op gofakeit.ID()BenchmarkID-10 31,383,146 37.8 ns 24 1 gofakeit.UUIDv4()BenchmarkUUIDv4-10 22,131,577 53.8 ns 48 1 github.com/rs/xidBenchmarkXID-10 16,190,817 74.2 ns 0 0 github.com/google/uuid(v4)BenchmarkGoogleUUIDv4-10 3,098,770 386.1 ns 64 2 Takeaway:
gofakeit.ID()is ~2× faster than XID and ~10× faster than UUID v4, while being shorter and human-readable.
Collision Probability (Randomness Math)
... (truncated)
93c1858
password - improve memery allocation and minor increase in op speedce78392
id - lookup updates and some other minor thingsaba6d6f
ids - moved uuid into ids file and add our own unique gofakeit id
generatorda6da65
faker - pcg seed create 2 separate seeds using crypto1e2c3fb
readme - added/organize idsae981a3
company - remove duplicate keyword/alias wording969e3c7
occupation - updated a few functions to favor job over emojijob1ef7578
occupation - updated a few functions to favor job over emojijoba93e4a9
readme - minor update to remove unused functionsf4eb855
text - added params back to sentence and paragraph to not break
builds