piece-length
v0.0.0 piece length torrent
piece-length
piece-length finds the optimal piece length for a given number of bytes. Optimal for what exactly? BitTorrent. VuzeWiki and TorrentFreak have both released some examples of ideal piece lengths, and this algorithm will reproduce them.
install
npm install piece-length
note: you may need to polyfill Math.log2
use
var optimum = require('piece-length')
// 350mb should be 256kb
optimum(367001600) // => 262144
obey
npm i [email protected]
Source Code
[email protected]:michaelrhodes...Metadata
- MIT
- Whatever
- Michael Rhodes
- released 10/25/2013