From 84fab63fc715c3b2d89935604ce1b7b00af7a14a Mon Sep 17 00:00:00 2001 From: Katherine A Miller Date: Sun, 4 Nov 2018 20:36:40 -0500 Subject: [PATCH] Update error correction --- .gitignore/error correction | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitignore/error correction b/.gitignore/error correction index 195f10a..c76c688 100644 --- a/.gitignore/error correction +++ b/.gitignore/error correction @@ -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