Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexpdev/piecelength
Calculating Ideal Piece Length for .torrent files
https://github.com/alexpdev/piecelength
bencode bittorrent-protocol torrent-files
Last synced: 24 days ago
JSON representation
Calculating Ideal Piece Length for .torrent files
- Host: GitHub
- URL: https://github.com/alexpdev/piecelength
- Owner: alexpdev
- License: bsd-2-clause
- Created: 2021-07-27T04:26:36.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-25T06:04:14.000Z (about 2 years ago)
- Last Synced: 2024-10-15T20:22:26.692Z (about 1 month ago)
- Topics: bencode, bittorrent-protocol, torrent-files
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Piece Length
Calculate ideal piece length for .torrent files.
Piece Length(`piecelength`) is a simple package that sole purpose is to calculate
the ideal piece length for the Bittorrent protocol based on the total size of
the torrent contents. Results are returned in integer form, and will always
be a perfect power of 2.## Install
The `piecelength` package can be installed from git:
```sh
git clone https://github.com/alexpdev/piecelength.git
cd piecelength
pip install .
```It is also available on PyPi:
```sh
pip install piecelength
```## Usage
To use the package as library:
```python
from piecelength import piece_lengthsize = 100000000 # some integer value
result = piece_length(size)
```It can also be used from the command line:
```sh
piecelength 3456677434645
```## License
Licensed with BSD 3 see the LICENSE file for more details.