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.1.0.tar.gz
(27.5 kB
view hashes)
Built Distribution
Close
Hashes for manchester_code-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23251eed4c91f42b8f05dd7e1cc4c97b895d9f7ad8dadaa0162b75680e282d37 |
|
MD5 | 94cb7a7ce057773be06e57dabedc26ea |
|
BLAKE2b-256 | 0102c9601fa2e9b87ea76de751838c5fd09cac61deee014c7256b9592a1cc7c2 |