integer_encodingA simple Python module that encodes integers into arbitrary-base element sequences | |
Download |
integer_encoding Ranking & Summary
Advertisement
- License:
- Public Domain
- Publisher Name:
- Gregg Gajic
- Publisher web site:
- https://github.com/gg/
integer_encoding Tags
integer_encoding Description
A simple Python module that encodes integers into arbitrary-base element sequences integer_encoding is a simple Python module that encodes integers into arbitrary-base element sequences.Usage:Encoding:>>> import integer_encoding>>> alphabet = 'abc123'>>> encode = integer_encoding.encoder(alphabet)>>> encode(0)>>> encode(1)>>> encode(2)>>> encode(6)>>> encode(1306)>>> encode(1307)Decoding:>>> import integer_encoding>>> decode = integer_encoding.decoder('abc123')>>> decode('a')0>>> decode('b')1>>> decode('c')2>>> decode('ba')6>>> decode('baab2')1306>>> decode('baab3')1307Installing:Install from PyPI:pip install integer_encodingor you grab the source and run:python setup.py installTestsTo run the tests, first install tox:pip install toxthen run tox from the project root directory:tox Requirements: · Python
integer_encoding Related Software