Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
x-hw committed Sep 6, 2016
1 parent 99d98b2 commit bd1002d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mylibs/ECC.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down

0 comments on commit bd1002d

Please sign in to comment.