From 772736120b54377dc291118984ca775689d6ac10 Mon Sep 17 00:00:00 2001 From: Szymon Wojciechowski Date: Mon, 25 Jun 2018 15:21:17 +0000 Subject: [PATCH] bugfix --- crc16.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crc16.py b/crc16.py index bd75c00..f3d1777 100644 --- a/crc16.py +++ b/crc16.py @@ -1,7 +1,5 @@ import sys import ast -import time -from itertools import zip_longest class Polynomial: @@ -77,7 +75,7 @@ def normalize_byte(data): if len(data) < 8: data = str(0) + data else: - data.replace(data[0], '') + data = data[1:] return data @@ -126,7 +124,9 @@ def check_fcs(in_data): def main(): try: if sys.argv[1] == '-e' or sys.argv[1] == '-encode': - print(encode(sys.argv[2])) + arg = encode(sys.argv[2]) + print(arg) + print(check_fcs(arg)) # powinno zawsze zwracać true elif sys.argv[1] == '-c' or sys.argv[1] == '-check': print(check_fcs(sys.argv[2])) else: @@ -136,4 +136,4 @@ def main(): if __name__ == "__main__": - main() + main() \ No newline at end of file