使用Python进行错误更正而不进行分块

时间:2017-01-30 14:54:46

标签: python error-correction

我在尝试使用Reed Solomon对(字节)字符串进行纠错,然后再将其发送到接收器。我使用以下library进行纠错,并使用以下MWE:

from reedsolo import RSCodec

with open("imageToSend.png", "rb") as pic:
  picContent = pic.read()

correctionLength = int((len(picContent)/100)*20)
rs = RSCodec(correctionLength)

rs.encode(picContent)

由于这对我的用例不起作用(删除整个255字节块不可恢复),我正在寻找一种新方法。我想做以下事情:

with open("imageToSend.png", "rb") as pic:
  picContent = pic.read()

# Create error correcting code of picContent and append it to the message (without chunking the message)

# Randomly delete 20% of the message

# Correct errors and restore original message

性能(速度)不是问题!

0 个答案:

没有答案