Documentation ¶
Index ¶
- type ID
- func (id ID) Bytes() []byte
- func (id ID) GetBit(i int) bool
- func (id ID) Int160() Int160
- func (id ID) IsZero() bool
- func (id ID) MarshalBencode() ([]byte, error)
- func (b ID) MarshalBinary() ([]byte, error)
- func (b ID) MarshalGQL(w io.Writer)
- func (b *ID) MarshalJSON() ([]byte, error)
- func (b *ID) Scan(value interface{}) error
- func (id ID) String() string
- func (id *ID) UnmarshalBencode(b []byte) error
- func (b *ID) UnmarshalBinary(data []byte) error
- func (b *ID) UnmarshalGQL(input interface{}) error
- func (b *ID) UnmarshalJSON(data []byte) error
- func (b ID) Value() (driver.Value, error)
- type Int160
- func (i Int160) AsByteArray() [20]byte
- func (i Int160) BitLen() int
- func (i Int160) ByteString() string
- func (i Int160) Bytes() []byte
- func (i Int160) Cmp(r Int160) int
- func (i Int160) Distance(b Int160) (ret Int160)
- func (i Int160) GetBit(index int) bool
- func (i Int160) IsZero() bool
- func (i Int160) String() string
- func (i Int160) WithBit(index int, val bool) Int160
- func (i Int160) WithMax() Int160
- func (i Int160) Xor(b1, b2 Int160) Int160
- type MutableID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID [20]byte
func MustNewIDFromByteSlice ¶
func MustParseID ¶
func NewIDFromByteSlice ¶
func NewIDFromRawString ¶
func RandomNodeID ¶
func RandomNodeID() (id ID)
func RandomNodeIDWithClientSuffix ¶ added in v0.3.0
func RandomNodeIDWithClientSuffix() (id ID)
RandomNodeIDWithClientSuffix generates a node ID for the DHT client. We use a random byte string with the client ID encoded at the end, to allow identifying other bitmagnet instances in the wild. A suffix is used instead of a prefix, which would be incompatible with DHT, where ID prefixes are used for computing the distance metric).
func RandomPeerID ¶
func RandomPeerID() ID
func (ID) MarshalBencode ¶
func (ID) MarshalBinary ¶
func (ID) MarshalGQL ¶
func (*ID) MarshalJSON ¶
func (*ID) UnmarshalBencode ¶
func (*ID) UnmarshalBinary ¶
func (*ID) UnmarshalGQL ¶
func (*ID) UnmarshalJSON ¶
type Int160 ¶
type Int160 struct {
// contains filtered or unexported fields
}
func NewInt160FromByteArray ¶
func (Int160) AsByteArray ¶
func (Int160) ByteString ¶
Click to show internal directories.
Click to hide internal directories.