PROTOTYPE
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,22 +1,19 @@
|
||||
import hashlib
|
||||
import os
|
||||
|
||||
# Anchor hashes.txt relative to the libs folder
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
HASH_LIST_PATH = os.path.join(
|
||||
BASE_DIR, "hashes.txt"
|
||||
) # or os.path.join(BASE_DIR, "..", "hashes.txt")
|
||||
)
|
||||
|
||||
|
||||
def hashcheck(fileToCheck):
|
||||
# Remove trailing spaces or wrapped quotes from drag-and-drop
|
||||
clean_path = str(fileToCheck).strip().strip('"').strip("'")
|
||||
|
||||
if not os.path.isfile(clean_path):
|
||||
print(f"Error: Path does not exist or is a directory: {clean_path}")
|
||||
return False
|
||||
|
||||
# Read file in binary mode and compute hash
|
||||
with open(clean_path, "rb") as f:
|
||||
digest = hashlib.file_digest(f, "sha256")
|
||||
file_hash = digest.hexdigest()
|
||||
|
||||
@@ -23138,3 +23138,4 @@ A1475A0042FE86E50531BB8B8182F9E27A3A61F204700F42FD26406C3BDEC862
|
||||
000000627a55405cf609a534f2bd38ab2b74a50b17b4db5c271ef3305e38c830
|
||||
00000048b1c9e60c14a6619f0292dea96df7f10c11cfa9ae28693219c0ae844b
|
||||
00000045ef6ec5eb590ef16ef79d467734ea7d9144d7990511514f08ed3cb673
|
||||
4F19AB252F8DC17EB245F69A99EB58FCAFA86794D3E3CD7F313DBA7C374D401A
|
||||
Reference in New Issue
Block a user