an alternative to the github.com/google/uuid
package
go get -u github.com/malivvan/uuid
package main
import (
"fmt"
"github.com/malivvan/uuid"
)
func main() {
// Generate a new UUID
id, err := uuid.New("TYPE", 8)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(id)
}
- Type Prefix
- Host Fingerprinting
- Unix Timestamp
- Data bytes with dynamic length
- CRC Checksum
| TYPE-SYSTEMID-UNIXSECOND-XXXXXXXXXXXXXXXX-CHECKSUM |
| 4 | 4 | 4 | N | 4 | = N + 16 bytes
> TEST-C05FA96E-1720977041-F0ADF56596E2C4FB-188A8A03
- Special thanks to Denis Brodbeck for his machineID implementation