Post by m***@beroal.in.uaHi. The correct value is torrent_info.piece_length(). It is always 2^n
where n is a natural number.
That's actually not guaranteed. It's very common to be the case though.
There are some torrents where the piece size is a multiple of 16 kB (but
not a power of 2) and there's nothing stopping a torrent from having any
arbitrary piece size either. It cannot be 0 or negative though.
Post by m***@beroal.in.uaPost by Alexander DyagilevHello,
What is the correct way to get one?
constautosizePerPiece=t->total_size()/s.pieces.size();
is NOT a correct one?
assuming "s" is a torrent_info object, you can either call
torrent_info::piece_size(int) and specify which piece you're interested in.
The last piece is likely smaller than the others.
If you want the piece size used for all pieces but the last one, you can
call torrent_info::piece_length().
--
Arvid Norberg