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

Function setClockSequence

time.go:97–108  ·  view source on GitHub ↗
(seq int)

Source from the content-addressed store, hash-verified

95}
96
97func setClockSequence(seq int) {
98 if seq == -1 {
99 var b [2]byte
100 randomBits(b[:]) // clock sequence
101 seq = int(b[0])<<8 | int(b[1])
102 }
103 oldSeq := clockSeq
104 clockSeq = uint16(seq&0x3fff) | 0x8000 // Set our variant
105 if oldSeq != clockSeq {
106 lasttime = 0
107 }
108}
109
110// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in
111// uuid. The time is only defined for version 1, 2, 6 and 7 UUIDs.

Callers 3

getTimeFunction · 0.85
clockSequenceFunction · 0.85
SetClockSequenceFunction · 0.85

Calls 1

randomBitsFunction · 0.85

Tested by

no test coverage detected