// Generated by Lisette bindgen
// Source: hash (Go stdlib)
// Go: 1.25.5
// Lisette: 0.1.12
/// A Cloner is a hash function whose state can be cloned, returning a value with
/// equivalent and independent state.
///
/// All [Hash] implementations in the standard library implement this interface,
/// unless GOFIPS140=v1.0.0 is set.
///
/// If a hash can only determine at runtime if it can be cloned (e.g. if it wraps
/// another hash), Clone may return an error wrapping [errors.ErrUnsupported].
/// Otherwise, Clone must always return a nil error.
pub interface Cloner {
fn BlockSize() -> int
fn Clone() -> Result<Cloner, error>
fn Reset()
fn Size() -> int
fn Sum(mut b: Slice<uint8>) -> Slice<uint8>
fn Write(p: Slice<uint8>) -> Partial<int, error>
}
/// Hash is the common interface implemented by all hash functions.
///
/// Hash implementations in the standard library (e.g. [hash/crc32] and
/// [crypto/sha256]) implement the [encoding.BinaryMarshaler], [encoding.BinaryAppender],
/// [encoding.BinaryUnmarshaler] and [Cloner] interfaces. Marshaling a hash implementation
/// allows its internal state to be saved and used for additional processing
/// later, without having to re-write the data previously written to the hash.
/// The hash state may contain portions of the input in its original form,
/// which users are expected to handle for any possible security implications.
///
/// Compatibility: Any future changes to hash or crypto packages will endeavor
/// to maintain compatibility with state encoded using previous versions.
/// That is, any released versions of the packages should be able to
/// decode data written with any previously released version,
/// subject to issues such as security fixes.
/// See the Go compatibility document for background: https://golang.org/doc/go1compat
pub interface Hash {
fn BlockSize() -> int
fn Reset()
fn Size() -> int
fn Sum(mut b: Slice<uint8>) -> Slice<uint8>
fn Write(p: Slice<uint8>) -> Partial<int, error>
}
/// Hash32 is the common interface implemented by all 32-bit hash functions.
pub interface Hash32 {
fn BlockSize() -> int
fn Reset()
fn Size() -> int
fn Sum(mut b: Slice<uint8>) -> Slice<uint8>
fn Sum32() -> uint32
fn Write(p: Slice<uint8>) -> Partial<int, error>
}
/// Hash64 is the common interface implemented by all 64-bit hash functions.
pub interface Hash64 {
fn BlockSize() -> int
fn Reset()
fn Size() -> int
fn Sum(mut b: Slice<uint8>) -> Slice<uint8>
fn Sum64() -> uint64
fn Write(p: Slice<uint8>) -> Partial<int, error>
}
/// XOF (extendable output function) is a hash function with arbitrary or unlimited output length.
pub interface XOF {
fn BlockSize() -> int
fn Read(mut p: Slice<uint8>) -> Partial<int, error>
fn Reset()
fn Write(p: Slice<uint8>) -> Partial<int, error>
}