You've already forked amazing-qr
mirror of
https://github.com/x-hw/amazing-qr.git
synced 2025-08-10 22:41:23 +02:00
fix a bug
This commit is contained in:
@@ -42,7 +42,8 @@ def encode(ver, ecl, data_codewords):
|
|||||||
en = ecc_num_per_block[ver-1][lindex[ecl]]
|
en = ecc_num_per_block[ver-1][lindex[ecl]]
|
||||||
ecc = []
|
ecc = []
|
||||||
for dc in data_codewords:
|
for dc in data_codewords:
|
||||||
ecc.append(get_ecc(dc, en))
|
test = get_ecc(dc, en)
|
||||||
|
ecc.append(test)
|
||||||
return ecc
|
return ecc
|
||||||
|
|
||||||
def get_ecc(dc, ecc_num):
|
def get_ecc(dc, ecc_num):
|
||||||
@@ -62,7 +63,7 @@ def divide(MP, *GP):
|
|||||||
GP[i] = po2[GP[i]]
|
GP[i] = po2[GP[i]]
|
||||||
return XOR(GP, *MP)
|
return XOR(GP, *MP)
|
||||||
else:
|
else:
|
||||||
return MP[1:]
|
return XOR([0]*len(GP), *MP)
|
||||||
|
|
||||||
|
|
||||||
def XOR(GP, *MP):
|
def XOR(GP, *MP):
|
||||||
|
Reference in New Issue
Block a user