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)
| 71 | // of id are used. If id is less than 6 bytes then false is returned and the |
| 72 | // Node ID is not set. |
| 73 | func 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. |
no outgoing calls