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

Function setClockSequence

time.go:102–113  ·  view source on GitHub ↗
(seq int)

Source from the content-addressed store, hash-verified

100}
101
102func setClockSequence(seq int) {
103 if seq == -1 {
104 var b [2]byte
105 randomBits(b[:]) // clock sequence
106 seq = int(b[0])<<8 | int(b[1])
107 }
108 oldSeq := clockSeq
109 clockSeq = uint16(seq&0x3fff) | 0x8000 // Set our variant
110 if oldSeq != clockSeq {
111 lasttime = 0
112 }
113}
114
115// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in
116// 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