From 5d36d517705ee5e998e8d4f35b2fa179ba7f1761 Mon Sep 17 00:00:00 2001 From: c0m4r Date: Wed, 10 Jan 2024 09:46:08 +0100 Subject: [PATCH] type annotations --- lib/helpers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/helpers.py b/lib/helpers.py index ef71c71..2e228c6 100644 --- a/lib/helpers.py +++ b/lib/helpers.py @@ -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():