"""
FulHash Types and Enums
Code generated by scripts/codegen/generate-fulhash-types.ts; DO NOT EDIT.
"""

from enum import StrEnum
from typing import Literal, TypedDict


class Algorithm(StrEnum):
    """
    Supported hashing algorithms for FulHash
    """

    XXH3_128 = "xxh3-128"
    """Fast non-cryptographic hash (default). Excellent collision resistance, extremely high throughput (50GB/s+)."""

    SHA256 = "sha256"
    """Cryptographic security standard. Resistant to intentional collisions. Use for security verification."""

    CRC32 = "crc32"
    """32-bit Cyclic Redundancy Check. Standard for GZIP/ZIP/PNG legacy format interoperability."""

    CRC32C = "crc32c"
    """32-bit CRC (Castagnoli). HW accelerated (SSE4.2/ARMv8). Use for cloud storage (GCS, AWS) and networking."""


class Digest(TypedDict, total=False):
    """
    Standard digest payload returned by FulHash helpers
    """

    algorithm: Literal["xxh3-128", "crc32", "crc32c", "sha256"]
    """Hash algorithm identifier"""

    hex: str
    """Lowercase hexadecimal representation of the digest"""

    formatted: str
    """Canonical string representation '<algorithm>:<hex>'"""

    bytes: list[int]
    """Raw digest bytes (optional)"""
