Beispiel #1
0
def filehash(filename):
    f = open(filename, "rb")
    print("opened")
    sum = hasher()
    for block in FileIter(f):
        sum.update(block)
    return sum.hexdigest()
Beispiel #2
0
Datei: util.py Projekt: F3DS/f3ds
 def _makehash(self, *values):
     hash = hasher()
     for value in values:
         hash.update(value)
     return hash
Beispiel #3
0
 def testUseHasher(self):
     'Test accessing hasher as imported.'
     expected = eval('hashlib.' + self.saved_algorithm.strip() + '()')
     actual = sethash.hasher()
     self.assertIsInstance(actual, type(expected))