Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
Fix checksum error
Browse files Browse the repository at this point in the history
  • Loading branch information
cugu committed Nov 25, 2018
1 parent e173c50 commit 2574a09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions afro/checksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2574a09

Please sign in to comment.