helper

package
v2.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLibp2pPeerIdWithPrivateKey added in v2.1.0

func CreateLibp2pPeerIdWithPrivateKey(privateKey crypto.PrivateKey) (string, error)

CreateLibp2pPeerIdWithPrivateKey create a peer.ID with crypto.PrivateKey.

func CreateLibp2pPeerIdWithPublicKey added in v2.1.0

func CreateLibp2pPeerIdWithPublicKey(publicKey crypto.PublicKey) (string, error)

CreateLibp2pPeerIdWithPublicKey create a peer.ID with crypto.PublicKey.

func GetLibp2pPeerIdFromCert

func GetLibp2pPeerIdFromCert(certPemBytes []byte) (string, error)

GetLibp2pPeerIdFromCert create a peer.ID with pubKey that contains in cert.

func GetLibp2pPeerIdFromCertDer added in v2.1.0

func GetLibp2pPeerIdFromCertDer(certDerBytes []byte) (string, error)

GetLibp2pPeerIdFromCertDer create a peer.ID with pubKey that contains in cert.

func GetNodeUidFromAddr

func GetNodeUidFromAddr(addr string) (string, error)

GetNodeUidFromAddr get the unique id of node from an addr. 从地址中截取出节点ID

func P2pAddressFormatVerify

func P2pAddressFormatVerify(address string) bool

P2pAddressFormatVerify verify a node address format.

func ParseGoPublicKeyToPubKey added in v2.1.0

func ParseGoPublicKeyToPubKey(publicKey goCrypto.PublicKey) (libp2pcrypto.PubKey, error)

ParseGoPublicKeyToPubKey parse a go crypto PublicKey to a libp2p crypto PubKey.

Types

This section is empty.

Directories

Path Synopsis
Package crypto implements various cryptographic utilities used by libp2p.
Package crypto implements various cryptographic utilities used by libp2p.
pb

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL