![]() ![]() Here is an example: > tampered_msg = b 'heXlo worXd \xed %T \xc4\xfd X \x89\xf3\xa8\xaa ' > decoded_msg, decoded_msgecc, errata_pos = rsc. and the list of positions of the errata (errors and erasures).the decoded message and error correction code (which is itself also corrected).Important upgrade notice for pre-1.0 users: Note that code() returns 3 variables: ReedSolomonError : Too many ( or few ) errors found by Chien Search for the errata locator polynomial ! decode ( b 'hXXXo worXd \xed %T \xc4\xfd XX \xf3\xa8\xaa ' ) # 6 errors - fail Traceback ( most recent call last ). decode ( b 'hXXXo worXd \xed %T \xc4\xfd X \x89\xf3\xa8\xaa ' ) # 5 errors b 'hello world' > rsc. ![]() decode ( b 'heXlo worXd \xed %T \xc4\xfd X \x89\xf3\xa8\xaa ' ) # 3 errors b 'hello world' > rsc. decode ( b 'hello world \xed %T \xc4\xfd\xfd\x89\xf3\xa8\xaa ' ) b 'hello world' > rsc. encode ( b 'hello world' ) b 'hello world \xed %T \xc4\xfd\xfd\x89\xf3\xa8\xaa ' # Note that chunking is supported transparently to encode any string length. Basic usage with high-level RSCodec class # Initialization > from reedsolo import RSCodec > rsc = RSCodec ( 10 ) # 10 ecc symbols # Encoding > rsc. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |