import math
def checksum(path):
value = 0
with open(path, "rb") as fp:
char = fp.peek(1)
while char:
char = fp.read(1)
if char in [b"\n", b"\r"]:
continue
if char:
value += int.from_bytes(char, byteorder="big", signed=True)
else:
value -= 1
value = int(math.fmod(value, 100000000))
return value