MCPcopy
hub / github.com/google/uuid / NewV6

Function NewV6

version6.go:24–30  ·  view source on GitHub ↗

UUID version 6 is a field-compatible version of UUIDv1, reordered for improved DB locality. It is expected that UUIDv6 will primarily be used in contexts where there are existing v1 UUIDs. Systems that do not involve legacy UUIDv1 SHOULD consider using UUIDv7 instead. see https://datatracker.ietf.o

()

Source from the content-addressed store, hash-verified

22// SetClockSequence then it will be set automatically. If GetTime fails to
23// return the current NewV6 returns Nil and an error.
24func NewV6() (UUID, error) {
25 now, seq, err := GetTime()
26 if err != nil {
27 return Nil, err
28 }
29 return generateV6(now, seq), nil
30}
31
32// NewV6WithTime returns a Version 6 UUID based on the current NodeID, clock
33// sequence, and a specified time. It is similar to the NewV6 function, but allows

Callers 1

TestVersion6Function · 0.85

Calls 2

GetTimeFunction · 0.85
generateV6Function · 0.85

Tested by 1

TestVersion6Function · 0.68