Skip to content

landonb/bhencode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bhencode

A simple Bencoder for Python based on BencodePy.

Differences from BencodePy

  • The encoder handles the non-standard elements, such as float, None, and bool.
  • The dict encoder is fixed so that dicts are sorted lexically by key name, otherwise the bencode string differs between uses.

Usage

The author uses bhencode to produce MD5 hashes of Python objects.

import bhencode
import hashlib

hashlib.md5(bhencode.encode(raw_data)).hexdigest()

Installation

The easiest way to install this library is using pip.

pip install https://github.com/landonb/bhencode/archive/master.zip

About

Pythonic bencoder supports floats and None for making unique hash IDs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.1%
  • Shell 1.9%