From bd1002dd8bba24175eca5ed8b027b07ac5b0370a Mon Sep 17 00:00:00 2001 From: sylnsfar Date: Tue, 6 Sep 2016 17:07:03 +0800 Subject: [PATCH] fix a bug --- mylibs/ECC.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mylibs/ECC.py b/mylibs/ECC.py index f124045..71eecf9 100644 --- a/mylibs/ECC.py +++ b/mylibs/ECC.py @@ -42,7 +42,8 @@ def encode(ver, ecl, data_codewords): en = ecc_num_per_block[ver-1][lindex[ecl]] ecc = [] for dc in data_codewords: - ecc.append(get_ecc(dc, en)) + test = get_ecc(dc, en) + ecc.append(test) return ecc def get_ecc(dc, ecc_num): @@ -62,7 +63,7 @@ def divide(MP, *GP): GP[i] = po2[GP[i]] return XOR(GP, *MP) else: - return MP[1:] + return XOR([0]*len(GP), *MP) def XOR(GP, *MP):