first commit

This commit is contained in:
w4nn4d13
2026-04-06 13:37:26 +05:30
commit 065eae9134
52 changed files with 1918 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
from __future__ import annotations
import hashlib
BLOCK_SIZE = 1024 * 64
def sha256_bytes(data: bytes) -> str:
digest = hashlib.sha256()
digest.update(data)
return digest.hexdigest()
def sha256_file(path: str) -> str:
digest = hashlib.sha256()
with open(path, "rb") as f:
while True:
block = f.read(BLOCK_SIZE)
if not block:
break
digest.update(block)
return digest.hexdigest()