def hashf(alg, file): fd = rw.openf(file, debug=False) h = new(alg) while True: data = fd.read(__buf) if not data: break h.update(data) # bytearray(data, 'utf-8') hex = h.hexdigest().lower() rw.closef(input) return hex
def fd(self): fd = openf(self.pname) self.fdl += [fd] return fd