Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update error correction
  • Loading branch information
kam17049 committed Nov 10, 2018
1 parent 68ec3c4 commit 9a8c275
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .gitignore/error correction
Expand Up @@ -163,3 +163,22 @@ def stripFrames(frames):
(payload, parityColumn, parityRow) = splitFrame(frame)
newFrames.append(payload)
return newFrames

def bin2string(frame, fill):
""" takes an 8x8 frame and fill and returns the string ecoded by the frame"""
string = []
for n in frame:
char = e.bin2char(n)
if char != fill:
string.append(char)
string = ''.join(string)
return string

def frames2string(frames, fill):
"""iterates over each frame in a list of frames and returns the strings encoded by the frames"""
newStrings = []
for frame in frames:
s1 = bin2string(frame, fill)
newStrings.append(s1)
newStrings = ''.join(newStrings)
return newStrings

0 comments on commit 9a8c275

Please sign in to comment.