Skip to content

find the optimal torrent piece length for a given number of bytes (73 B)

Notifications You must be signed in to change notification settings

michaelrhodes/piece-length

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

build status

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

MIT

About

find the optimal torrent piece length for a given number of bytes (73 B)

Resources

Stars

Watchers

Forks

Packages

No packages published