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.0.tar.gz
(25.8 kB
view hashes)
Built Distribution
Close
Hashes for manchester_code-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe7b75702c77dd1c8ab66466535c064f1f668bb9442ebf7569881fdb6a88f971 |
|
MD5 | 514f13e2ed1471d9ac53ba7a815d84cb |
|
BLAKE2b-256 | b0e928e166cf3a9f05ec93021ce6446519adf53394d4f820365681a43da19415 |