import hashlib

def checksum(f, h = hashlib.sha256(), blocksize = 2**15):
	chunk = f.read(blocksize)
	while len(chunk) > 0:
		h.update(chunk)
		chunk = f.read(blocksize)
	return h

@@ -33,24 +33,12 @@
 h = 
-hashlib.sha256()
+None
 , bl
@@ -55,16 +55,53 @@
 2**15):%0A
+%09if h == None : h = hashlib.sha256()%0A
 %09chunk =

fix default-parameter-initialized-only-once bug in checksum