Update hasher.py

This commit is contained in:
joe-arriaga 2019-01-26 12:05:07 -08:00 committed by GitHub
parent 368bc0964c
commit 0f7d844dda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,26 +2,26 @@ import hashlib
hasher = hashlib.md5()
with open ('simple_policy.py', 'rb') as afile:
buf = afile.read()
hasher.update(buf)
buf = afile.read()
hasher.update(buf)
print("md5 of simple: " + hasher.hexdigest())
hasher = hashlib.md5()
with open ('moderate_policy.py', 'rb') as afile:
buf = afile.read()
hasher.update(buf)
buf = afile.read()
hasher.update(buf)
print("md5 of moderate: " + hasher.hexdigest())
hasher = hashlib.sha1()
with open ('simple_policy.py', 'rb') as afile:
buf = afile.read()
hasher.update(buf)
buf = afile.read()
hasher.update(buf)
print("sha1 of simple: " + hasher.hexdigest())
hasher = hashlib.sha1()
with open ('moderate_policy.py', 'rb') as afile:
buf = afile.read()
hasher.update(buf)
buf = afile.read()
hasher.update(buf)
print("sha1 of moderate: " + hasher.hexdigest())