This repository has been archived on 2026-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
SpideyDetector/modules/test_sha.py

26 lines
568 B
Python

"""
Sha256 hash function.
"""
from hashlib import sha256
from modules import test_template, internal_io
def sha256_hash(path: str) -> hex:
"""
Returns the sha256 hash of the data.
"""
with open(path, "rb") as f:
return sha256(f.read()).hexdigest()
class Sha256(test_template.TestWalkTemplateSimpleFunction):
"""
Sha256 hash function.
"""
def __init__(self, thread_parameters: internal_io.thread_parameters):
"""
Sha256 hash function.
"""
super().__init__(thread_parameters, sha256_hash, "")