Skip to content

Commit

Permalink
type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
c0m4r committed Jan 10, 2024
1 parent a0f81c4 commit 5d36d51
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,20 @@
# Helper Functions -------------------------------------------------------------


def generateHashes(filedata):
def generateHashes(filedata: bytes) -> tuple[str, str, str]:
try:
md5 = hashlib.md5()
sha1 = hashlib.sha1()
sha256 = hashlib.sha256()

md5.update(filedata)
sha1.update(filedata)
sha256.update(filedata)

return md5.hexdigest(), sha1.hexdigest(), sha256.hexdigest()
except Exception:
traceback.print_exc()
return 0, 0, 0
return "0", "0", "0"


def getExcludedMountpoints():
Expand Down

0 comments on commit 5d36d51

Please sign in to comment.