INNER CODE UNIT · Python

sha256_bytes

IvanMurzak/Unity-MCP · .github/scripts/chain_feed.py:533

def sha256_bytes(data):
    return hashlib.sha256(data).hexdigest()


def sha256_file(path):
    digest = hashlib.sha256()
    with open(str(path), "rb") as handle:
        for chunk in iter(lambda: handle.read(1024 * 1024), b""):
            digest.update(chunk)
    return digest.hexdigest()


def log(line):
    print(line, flush=True)


def read_text(path):
    """Read with newline translation OFF so a CRLF file survives a surgical edit."""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…