Skip to content

Commit

Permalink
Update error correction
Browse files Browse the repository at this point in the history
  • Loading branch information
kam17049 authored Nov 5, 2018
1 parent c764864 commit 84fab63
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .gitignore/error correction
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,17 @@ def string2bin(string):
return stringList

def segmentString(string, fill):

desiredWidth = 8
s1 = []
if len(string) <= 8:
while len(string) < desiredWidth:
string += fill
s1.append(string)
return s1
else:
s1.append(string[0:8])
s2 = string[8:]
while len(s2) < desiredWidth:
s2 += fill
s1.append(s2)
return s1

0 comments on commit 84fab63

Please sign in to comment.