package meta import "crypto/sha1" type Piece struct { Offset int Length int Sum [sha1.Size]byte } func (p Piece) Check(b []byte) bool { return sha1.Sum(b) == p.Sum } func (p Piece) Size() int { return p.Length }