Skip to content

User eXperience focused IDentifiers - Go implementation

License

Notifications You must be signed in to change notification settings

riddler/uxid-go

Repository files navigation

UXID

MIT License

User eXperience focused IDentifiers (UXIDs) are identifiers which:

  • Describe the resource (aid in debugging and investigation)
  • Work well with copy and paste (double clicking selects the entire ID)
  • Can be shortened for low cardinality resources
  • Are secure against enumeration attacks
  • Can be generated by application code (not tied to the datastore)
  • Are K-sortable (lexicographically sortable by time - works well with datastore indexing)
  • Do not require any coordination (human or automated) at startup, or generation
  • Are very unlikely to collide (more likely with less randomness)
  • Are easily and accurately transmitted to another human using a telephone

Many of the concepts of Stripe IDs have been used in this library.

Usage

Generating UXIDs via the CLI

go run cli/main.go --prefix=cus --size=small # cus_01ER59H9BVY1R0
go run cli/main.go --prefix=txn --size=xl    # txn_01ER59HZ556GREFZ57T1RNYV21

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/riddler/uxid-go.

License

The project is available as open source under the terms of the MIT License.

About

User eXperience focused IDentifiers - Go implementation

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published