From 2574a09e3cc435f0f1e1eb89cb40ba195c3c20c8 Mon Sep 17 00:00:00 2001 From: cugu Date: Sun, 25 Nov 2018 12:31:20 +0100 Subject: [PATCH] Fix checksum error --- afro/checksum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afro/checksum.py b/afro/checksum.py index 5092b93..1d177cc 100644 --- a/afro/checksum.py +++ b/afro/checksum.py @@ -10,9 +10,9 @@ def create_checksum(data): for i in range(int(len(data) / 4)): dtype = np.dtype(np.uint32) dtype = dtype.newbyteorder('L') - data = np.frombuffer(data[i * 4:(i + 1) * 4], dtype=dtype) + value = np.frombuffer(data[i * 4:(i + 1) * 4], dtype=dtype) - sum1 = (sum1 + np.uint64(data)) % mod_value + sum1 = (sum1 + np.uint64(value)) % mod_value sum2 = (sum2 + sum1) % mod_value check1 = mod_value - ((sum1 + sum2) % mod_value)