Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

Commit b16172f

Browse files
committed
Fix random to 64 bits
1 parent ec8ac80 commit b16172f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tracer/util.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@ func randomID() uint64 {
2222
func randomID2() (uuid.UUID, uint64) {
2323
seededIDLock.Lock()
2424
defer seededIDLock.Unlock()
25-
return uuid.New(), uint64(seededIDGen.Int63())
25+
rndBytes := make([]byte, 8)
26+
seededIDGen.Read(rndBytes)
27+
uuidBytes := append(make([]byte, 8), rndBytes...)
28+
tid, _ := uuid.FromBytes(uuidBytes)
29+
return tid, uint64(seededIDGen.Int63())
2630
}

0 commit comments

Comments
 (0)