// Generated by Lisette bindgen
// Source: hash/crc32 (Go stdlib)
// Go: 1.25.5
// Lisette: 0.1.14

import "go:hash"

/// Checksum returns the CRC-32 checksum of data
/// using the polynomial represented by the [Table].
pub fn Checksum(data: Slice<uint8>, tab: Ref<Table>) -> uint32

/// ChecksumIEEE returns the CRC-32 checksum of data
/// using the [IEEE] polynomial.
pub fn ChecksumIEEE(data: Slice<uint8>) -> uint32

pub fn MakeTable(poly: uint32) -> Ref<Table>

/// New creates a new [hash.Hash32] computing the CRC-32 checksum using the
/// polynomial represented by the [Table]. Its Sum method will lay the
/// value out in big-endian byte order. The returned Hash32 also
/// implements [encoding.BinaryMarshaler] and [encoding.BinaryUnmarshaler] to
/// marshal and unmarshal the internal state of the hash.
pub fn New(tab: Ref<Table>) -> hash.Hash32

/// NewIEEE creates a new [hash.Hash32] computing the CRC-32 checksum using
/// the [IEEE] polynomial. Its Sum method will lay the value out in
/// big-endian byte order. The returned Hash32 also implements
/// [encoding.BinaryMarshaler] and [encoding.BinaryUnmarshaler] to marshal
/// and unmarshal the internal state of the hash.
pub fn NewIEEE() -> hash.Hash32

/// Update returns the result of adding the bytes in p to the crc.
pub fn Update(crc: uint32, tab: Ref<Table>, p: Slice<uint8>) -> uint32

/// Table is a 256-word table representing the polynomial for efficient processing.
pub struct Table(Slice<uint32>)

/// Predefined polynomials.
const Castagnoli = 0x82f63b78

/// Predefined polynomials.
const IEEE = 0xedb88320

/// Predefined polynomials.
const Koopman = 0xeb31d82e

/// The size of a CRC-32 checksum in bytes.
const Size = 4

/// IEEETable is the table for the [IEEE] polynomial.
pub var IEEETable: Ref<Table>
