Snowflake-like Unique ID generator
Arguments:
- EpochOffset 5730518316208800 (example) Epoch offset in microseconds (should remain consistent in all instances)
- GemID 0-15 (default config) Must be unique across generator instances; otherwise, IDs can duplicate!
package main
import (
"fmt"
"pkg.nyaa.science/gemshards"
)
func main() {
generator := gemshards.Gem{EpochOffset: 5730518316208800, GemID: 0}
shard := generator.Generate()
fmt.Println("Unique ID:", shard.ID)
}
Please write commit messages according to Chris Beams' guide 😊
Thank you very much for reading this 🙇🏼♀️