Initial commit

This commit is contained in:
2018-10-14 22:23:54 +02:00
commit 90957931f2
6 changed files with 959 additions and 0 deletions

24
gcksum.py Normal file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from binascii import hexlify
from struct import unpack
import sys
FILE = sys.argv[1]
print("Opening {}".format(FILE))
csum = 0
with open(FILE, "rb") as f:
while True:
block = f.read(1024)
for c in block:
csum += c
csum &= 0xff
if len(block) < 1024:
print("End reached.")
break
print("Sum of all bytes: {}".format(csum))