Skip to content

Commit

Permalink
implemented getSha1Digest function
Browse files Browse the repository at this point in the history
  • Loading branch information
Mithilan16 committed Nov 1, 2017
1 parent 697b5a7 commit 20c5b58
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions getSha1Digest.py
@@ -0,0 +1,9 @@
import hashlib
## The following function returns the sha1 digest from a file containing text
## To use, call the function as follows print getSha1Digest("path/to/file")
def getSha1Digest(path):
f = open(path)
path = f.read()
m = hashlib.sha1(path)

return m.hexdigest()

0 comments on commit 20c5b58

Please sign in to comment.