UUID version 7 features a time-ordered value field derived from the widely implemented and well known Unix Epoch timestamp source, the number of milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded. As well as improved entropy characteristics over versions 1 or 6. see https://d
()
| 21 | // Uses the randomness pool if it was enabled with EnableRandPool. |
| 22 | // On error, NewV7 returns Nil and an error |
| 23 | func NewV7() (UUID, error) { |
| 24 | uuid, err := NewRandom() |
| 25 | if err != nil { |
| 26 | return uuid, err |
| 27 | } |
| 28 | makeV7(uuid[:]) |
| 29 | return uuid, nil |
| 30 | } |
| 31 | |
| 32 | // NewV7FromReader returns a Version 7 UUID based on the current time(Unix Epoch). |
| 33 | // it use NewRandomFromReader fill random bits. |