key

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DistInt

func DistInt(x, y Key) *big.Int

func Equal

func Equal(x, y Key) bool

Types

type Key

type Key []byte

Key is a vector of bits backed by a Go byte slice. First byte is most significant. First bit (in each byte) is least significant.

func ByteKey

func ByteKey(b byte) Key

func BytesKey

func BytesKey(b []byte) Key

func KbucketIDToKey

func KbucketIDToKey(id kbucket.ID) Key

func Xor

func Xor(x, y Key) Key

func (Key) BitAt

func (k Key) BitAt(offset int) byte

func (Key) BitLen

func (k Key) BitLen() int

func (Key) BitString

func (k Key) BitString() string

BitString returns a bit representation of the key, in descending order of significance.

func (Key) NormInt

func (k Key) NormInt() *big.Int

func (Key) String

func (k Key) String() string

Jump to

Keyboard shortcuts

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