import hashlib

from app.utils import compute_sha256


def test_sha256_known_bytes():
    data = b"hello world"
    expected = hashlib.sha256(data).hexdigest()
    assert compute_sha256(data) == expected


def test_sha256_empty_bytes():
    data = b""
    expected = hashlib.sha256(data).hexdigest()
    assert compute_sha256(data) == expected


def test_sha256_returns_64_char_hex():
    result = compute_sha256(b"test data")
    assert len(result) == 64
    assert all(c in "0123456789abcdef" for c in result)
