NodeID returns a slice of a copy of the current Node ID, setting the Node ID if not already set.
()
| 58 | // NodeID returns a slice of a copy of the current Node ID, setting the Node ID |
| 59 | // if not already set. |
| 60 | func NodeID() []byte { |
| 61 | defer nodeMu.Unlock() |
| 62 | nodeMu.Lock() |
| 63 | if nodeID == zeroID { |
| 64 | setNodeInterface("") |
| 65 | } |
| 66 | nid := nodeID |
| 67 | return nid[:] |
| 68 | } |
| 69 | |
| 70 | // SetNodeID sets the Node ID to be used for Version 1 UUIDs. The first 6 bytes |
| 71 | // of id are used. If id is less than 6 bytes then false is returned and the |