PubKeyToID returns the ID corresponding to the given PubKey. It's the hex-encoding of the pubKey.Address().
(pubKey crypto.PubKey)
| 42 | // PubKeyToID returns the ID corresponding to the given PubKey. |
| 43 | // It's the hex-encoding of the pubKey.Address(). |
| 44 | func PubKeyToID(pubKey crypto.PubKey) ID { |
| 45 | return ID(hex.EncodeToString(pubKey.Address())) |
| 46 | } |
| 47 | |
| 48 | // LoadOrGenNodeKey attempts to load the NodeKey from the given filePath. If |
| 49 | // the file does not exist, it generates and saves a new NodeKey. |