Categorygithub.com/Vince155/prefixed-distributed-ids
repositorypackage
0.1.0
Repository: https://github.com/vince155/prefixed-distributed-ids.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

Prefixed ID Generator

Basing this distributed ID generator off of MongoDB's ObjectId

The ObjectId consists of the following:

  • A timestamp measured in seconds - 4 bytes

  • A random value generated from a cryptographically random number generator. The value is unique to the machine - 5 bytes

  • An incrementing counter. Initialized to a random value - 2 bytes

Those elements will combine to generate a 11-byte unique ID from which a prefix can be added e.g.