MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / PubKeyToID

Function PubKeyToID

p2p/key.go:44–46  ·  view source on GitHub ↗

PubKeyToID returns the ID corresponding to the given PubKey. It's the hex-encoding of the pubKey.Address().

(pubKey crypto.PubKey)

Source from the content-addressed store, hash-verified

42// PubKeyToID returns the ID corresponding to the given PubKey.
43// It's the hex-encoding of the pubKey.Address().
44func 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.

Calls 2

IDTypeAlias · 0.70
AddressMethod · 0.65