Trees | Indices | Help |
|
---|
|
1 # Copyright (C) 2010-2013 Claudio Guarnieri. 2 # Copyright (C) 2014-2016 Cuckoo Foundation. 3 # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org 4 # See the file 'docs/LICENSE' for copying permission. 5 6 BUFSIZE = 1024*1024 7 810 """Calculates an hash on a file by path. 11 @param method: callable hashing method 12 @param path: file path 13 @return: computed hash string 14 """ 15 f = open(path, "rb") 16 h = method() 17 while True: 18 buf = f.read(BUFSIZE) 19 if not buf: 20 break 21 h.update(buf) 22 return h.hexdigest()23
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Nov 4 23:22:04 2016 | http://epydoc.sourceforge.net |