diff --git a/metainfo/piece-length.go b/metainfo/piece-length.go index 183b4d86..c483e037 100644 --- a/metainfo/piece-length.go +++ b/metainfo/piece-length.go @@ -41,6 +41,9 @@ const ( const targetPieceCountMax = targetPieceCountMin << 1 // Choose a good piecelength. +// piecelength >= 16KB +// piecelength = 16KB*X +// totalLength / piecelength = piecenumber < 2048 func ChoosePieceLength(totalLength int64) (pieceLength int64) { // Must be a power of 2. // Must be a multiple of 16KB