peer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID protobuf.ID

ID is an identity of nodes, using its public key and network address.

func CreateID

func CreateID(address string, publicKey []byte) ID

CreateID is a factory function creating ID.

func (ID) Equals

func (id ID) Equals(other ID) bool

Equals determines if two peer IDs are equal to each other based on the contents of their public keys.

func (ID) Less

func (id ID) Less(other interface{}) bool

Less determines if this peer ID's public key is less than other ID's public key.

func (ID) PrefixLen

func (id ID) PrefixLen() int

PrefixLen returns the number of prefixed zeros in a peer ID.

func (ID) PublicKeyHex

func (id ID) PublicKeyHex() string

PublicKeyHex generates a hex-encoded string of public key of this given peer ID.

func (ID) String

func (id ID) String() string

String returns the identity address and public key.

func (ID) Xor

func (id ID) Xor(other ID) ID

Xor performs XOR (^) over another peer ID's public key.

Jump to

Keyboard shortcuts

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