status-go/vendor/github.com/anacrolix/dht/v2/krpc/compact-infohashes.go

24 lines
544 B
Go

package krpc
type Infohash [20]byte
type CompactInfohashes [][20]byte
func (CompactInfohashes) ElemSize() int { return 20 }
func (me CompactInfohashes) MarshalBinary() ([]byte, error) {
return marshalBinarySlice(me)
}
func (me CompactInfohashes) MarshalBencode() ([]byte, error) {
return bencodeBytesResult(me.MarshalBinary())
}
func (me *CompactInfohashes) UnmarshalBinary(b []byte) error {
return unmarshalBinarySlice(me, b)
}
func (me *CompactInfohashes) UnmarshalBencode(b []byte) error {
return unmarshalBencodedBinary(me, b)
}