Add Piece.Hash()

This commit is contained in:
Matt Joiner 2015-02-27 13:00:05 +11:00
parent daf93c8232
commit b4d3b0d11a
1 changed files with 4 additions and 0 deletions

View File

@ -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}
}