The way I understand the torrent file format is that it contains a field pieces
, which specifies a hash list of each piece's SHA-1 hash. But, does it specify how large each piece should be and at which byte the division should occur? How does the client know how to divide the original file?
Thanks
You are looking for the "piece length" in the Info dictionary. Every piece is of equal length except for the final piece, which is irregular. The number of pieces is thus determined by 'ceil( total length / piece size )'.
https://wiki.theory.org/BitTorrentSpecification#Info_Dictionary