add the scripts
This commit is contained in:
parent
26501f220e
commit
fcecf1a04b
12 changed files with 490 additions and 0 deletions
26
cloakcatcher/hash_data.py
Executable file
26
cloakcatcher/hash_data.py
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
# hash_data.py
|
||||
# Made by user333_
|
||||
# Meant to be included with main.py
|
||||
|
||||
from hashlib import sha256
|
||||
from sys import exit
|
||||
|
||||
def hash_data(data: str) -> str:
|
||||
|
||||
try:
|
||||
|
||||
data = data.encode()
|
||||
h = sha256()
|
||||
h.update(data)
|
||||
hashed_data = h.hexdigest()
|
||||
return hashed_data
|
||||
|
||||
except Exception:
|
||||
|
||||
raise Exception(f"[ERROR] Failed to hash binary data '{data}'")
|
||||
exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
raise Exception("[ERROR] You ran the wrong script, run main.py instead.")
|
||||
exit(1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue