c,python: Use little-endina byte order for bigint arithmetics

This better matches what one would expect from the hex or base64
(upcoming) formats.
This commit is contained in:
2021-11-15 01:13:17 +01:00
parent cc473f4c24
commit bcae51ead9
7 changed files with 51 additions and 56 deletions

View File

@ -8,8 +8,7 @@ bh = passgeny.bhash.Bhash()
bh.from_bytes(TEST_STRING)
# Scan the string in reverse order (::-1) as bhash should use big endian arithmetics
for c in TEST_STRING[::-1]:
for c in TEST_STRING:
hc = bh.modulo(256)
if hc != c:
raise Exception("Returned value is {}, expected {}".format(chr(hc), c))