code:python_reedsolomon
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
code:python_reedsolomon [2008/02/21 06:18] – laurenceb | code:python_reedsolomon [2008/07/19 23:33] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Main code (uses a c library for decoding, as the tx only has to encode, and we're assuming running binaries on the ground is easy) ===== | ||
+ | |||
+ | The decoder can be found at [[http:// | ||
+ | |||
<code python> | <code python> | ||
# | # | ||
Line 138: | Line 142: | ||
</ | </ | ||
+ | |||
+ | ===== Usage example ===== | ||
+ | |||
+ | <code python> | ||
+ | import reed_solomon | ||
+ | reed_solomon.setup_rs() | ||
+ | s=reed_solomon.encode_string(" | ||
+ | print s | ||
+ | t=s[0: | ||
+ | d = reed_solomon.decode_string(t, | ||
+ | print d[0] | ||
+ | print " | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== produces: ===== | ||
+ | |||
+ | < | ||
+ | $ python testcode.py | ||
+ | hello world my name is Laurence and I am your supreme ruler !!!111!!111! dJ{, | ||
+ | | ||
+ | hello world my name is Laurence and I am your supreme ruler !!!111!!111! | ||
+ | Errors at: [84, 85] | ||
+ | </ | ||
+ |
code/python_reedsolomon.1203574689.txt.gz · Last modified: 2008/07/19 23:31 (external edit)