Python library to encode & decode data as Manchester code
Project description
manchester-code
Python library to encode & decode data as Manchester code
Setup
$ pip3 install --user --upgrade manchester-code
Usage
0-bits translate to low-high, 1-bits to high-low (G. E. Thomas convention).
import manchester-code
manchester_code = encode([0b00001111, 0b01101001])
print(''.join(['{:08b}'.format(m) for m in manchester_code]))
# 01010101101010100110100110010110
encode(b'msg')
# b'i\xa6jZij'
decode([0b01010101, 0b10101010, 0b01101001, 0b10010110])
# 0000111101101001
decode(b'ieiVjeiV')
# b'data'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
manchester-code-1.0.1.tar.gz
(26.4 kB
view details)
Built Distribution
File details
Details for the file manchester-code-1.0.1.tar.gz
.
File metadata
- Download URL: manchester-code-1.0.1.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10031c7e7e28e860057348a9be45f33050d30ae35191f00d3bbc95ee4940c209 |
|
MD5 | 0691ca529b129eec70e8564d8991fe20 |
|
BLAKE2b-256 | fb31d591eb945f62090c0dcb4db781b093e313fa3ed7b66dc70d03f8babe3682 |
File details
Details for the file manchester_code-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: manchester_code-1.0.1-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a73e923f39a0242a3f6330251e818c96c418f057df801d6efa113a943583428 |
|
MD5 | 97c5b657d81416fdcc4645a431885313 |
|
BLAKE2b-256 | 24c6706067819fde47f3e7143de05ce22fee1ed27829224e45b3cfb358236428 |