1 2 3 4 5 6 7 8 9 10 11
from _hash import * def file_hash(name): h = Hash() f = open(name) data = f.read(32768) while data: h.update(data) data = f.read(32768) f.close() return h