Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mport os
- import hashlib
- def filerunk(file_path):
- for dirname, dirs, files in os.walk(file_path):
- for filename in files:
- full = os.path.join(dirname, filename)
- if not os.path.isfile(full):
- continue
- hash = hashlib.sha1()
- f = file(full, "rb")
- while 1:
- bytes = f.read(1000000)
- if not bytes:
- break
- hash.update(bytes)
- print full, hash.hexdigest()
- if __name__ == "__main__":
- filerunk("/tmp")
Add Comment
Please, Sign In to add comment