-
Notifications
You must be signed in to change notification settings - Fork 3
Package goguid is a GUID generation library based on noeqd / snowflake.
License
marpie/goguid
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Package goguid is a GUID generation library based on noeqd / snowflake.
All credit belongs to them!
GUID generation and guarantees (GUID size = 64 bit unsigned)
- time - 42 bit - millisecond precision (~ 100 years)
- machine id - 10 bit - max. 1024 machines
- sequence number - 12 bit - rolls over after 4096 id's in one millisecond
Performance
On a DELL Latitude (i5 2.4GHz) notebook it generates approx. 4 million GUID
per second.
Usage
// Initialize the package
guid.InitGUID(0, 0)
for i := int64(0); i < max_guids; i++ {
if guid.GetGUID() != 0 {
counter++
}
}
About
Package goguid is a GUID generation library based on noeqd / snowflake.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published