Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sz3/pywirehair
Python wrapper for wirehair
https://github.com/sz3/pywirehair
error-correcting-codes fountain-codes
Last synced: about 1 month ago
JSON representation
Python wrapper for wirehair
- Host: GitHub
- URL: https://github.com/sz3/pywirehair
- Owner: sz3
- License: mit
- Created: 2020-11-18T02:19:25.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-06T02:00:26.000Z (over 1 year ago)
- Last Synced: 2023-08-09T02:52:26.407Z (over 1 year ago)
- Topics: error-correcting-codes, fountain-codes
- Language: C++
- Homepage:
- Size: 276 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## pywirehair
A python wrapper for the [wirehair](https://github.com/catid/wirehair) forward error correction C/C++ library. wirehair is included as a git subtree.
I'll probably put some wheels in pypi sooner or later. In the meantime:
```
python setup.py build
python setup.py install
```or maybe:
`pip install https://github.com/sz3/pywirehair/archive/master.zip`## Usage
```
from pywirehair import encoder, decoderdata = b'0123456789' * 10
enc = encoder(data, 40)
a = enc.encode(0)dec = decoder(len(data), 40)
dec.decode(0, a)for i in range(2,4): # skip 1 for fun
print(i)
a = enc.encode(i)
print(dec.decode(i, a))
```decoder.decode() will return `None` if there is more work to do, or the decoded value if all is well. Error cases are not incredibly well handled at the moment, but should explode in predictable and obvious ways.