piece-length

WebJar for piece-length

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

piece-length
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

piece-length
WebJar for piece-length
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/michaelrhodes/piece-length

Download piece-length

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/piece-length/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>piece-length</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/piece-length/
implementation 'org.webjars.npm:piece-length:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/piece-length/
implementation ("org.webjars.npm:piece-length:1.0.0")
'org.webjars.npm:piece-length:jar:1.0.0'
<dependency org="org.webjars.npm" name="piece-length" rev="1.0.0">
  <artifact name="piece-length" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='piece-length', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "piece-length" % "1.0.0"
[org.webjars.npm/piece-length "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : closest-to jar [2.0.0,2.1)

Project Modules

There are no modules declared in this project.

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

Versions

Version
1.0.0