infohash_v2

package
v0.0.0-...-53dd17f Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Size = sha256.Size

Variables

This section is empty.

Functions

func ToMultihash

func ToMultihash(t T) multihash.Multihash

Types

type T

type T [Size]byte

32-byte SHA2-256 hash. See BEP 52.

func FromHexString

func FromHexString(s string) (h T)

func HashBytes

func HashBytes(b []byte) (ret T)

func (*T) AsString

func (t *T) AsString() string

func (*T) Bytes

func (t *T) Bytes() []byte

func (*T) Format

func (t *T) Format(f fmt.State, c rune)

func (*T) FromHexString

func (t *T) FromHexString(s string) (err error)

func (*T) HexString

func (t *T) HexString() string

func (T) MarshalText

func (t T) MarshalText() (text []byte, err error)

func (*T) String

func (t *T) String() string

func (*T) ToShort

func (t *T) ToShort() (short *infohash.T)

Truncates the hash to 20 bytes for use in auxiliary interfaces, like DHT and trackers.

func (*T) UnmarshalText

func (t *T) UnmarshalText(b []byte) error

Jump to

Keyboard shortcuts

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