Add Piece.Hash()
This commit is contained in:
parent
daf93c8232
commit
b4d3b0d11a
|
@ -78,6 +78,10 @@ func (me piece) Length() int64 {
|
|||
return me.Info.PieceLength
|
||||
}
|
||||
|
||||
func (me piece) Hash() []byte {
|
||||
return me.Info.Pieces[me.i*20 : (me.i+1)*20]
|
||||
}
|
||||
|
||||
func (me *Info) Piece(i int) piece {
|
||||
return piece{me, i}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue