-
Notifications
You must be signed in to change notification settings - Fork 411
Open
Description
Line 35 in 2d3c2a9
| func (t Time) UnixTime() (sec, nsec int64) { |
The time in the UUID of version 6 is not strictly monotonically increasing, as the sixth byte is reset by the version. Will it be improved?
As follow code, it will panic with bad
`
t := make([]time.Time, 0, 10000)
for i := 0; i < 10000; i++ {
u, _ := uuid.NewV6()
t = append(t, time.Unix(u.Time().UnixTime()).UTC())
if i > 0 && t[len(t)-1].Before(t[len(t)-2]) {
panic("bad")
}
}
`
primexiao and nicumicle
Metadata
Metadata
Assignees
Labels
No labels