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

Function SetNodeID

node.go:73–82  ·  view source on GitHub ↗

SetNodeID sets the Node ID to be used for Version 1 UUIDs. The first 6 bytes of id are used. If id is less than 6 bytes then false is returned and the Node ID is not set.

(id []byte)

Source from the content-addressed store, hash-verified

71// of id are used. If id is less than 6 bytes then false is returned and the
72// Node ID is not set.
73func SetNodeID(id []byte) bool {
74 if len(id) < 6 {
75 return false
76 }
77 defer nodeMu.Unlock()
78 nodeMu.Lock()
79 copy(nodeID[:], id)
80 ifname = "user"
81 return true
82}
83
84// NodeID returns the 6 byte node id encoded in uuid. It returns nil if uuid is
85// not valid. The NodeID is only well defined for version 1 and 2 UUIDs.

Callers 2

TestNodeFunction · 0.85
TestNodeIDFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestNodeFunction · 0.68
TestNodeIDFunction · 0.68