Digest

Mojo trait 🡭

Digest

Aliases

  • BLOCK_SIZE = : Size of the compression function’s input block, in bytes.
  • OUTPUT_SIZE = : Size of the digest finalize returns, in bytes.

Implemented traits

AnyType

Methods

__init__

fn def __init__(out self)

Initialize the hash to its initial state.

Args:

  • self (Self)

Returns:

_Self

update

fn def update[o: Origin[mut=o.mut]](mut self, data: Span[UInt8, o])

Absorb more input.

Parameters:

  • o (Origin[mut=mut])

Args:

  • self (Self)
  • data (Span[UInt8, o])

finalize

fn def finalize(var self) -> Array[UInt8, _Self.OUTPUT_SIZE]

Consume self and return the OUTPUT_SIZE-byte digest.

Args:

  • self (Self)

Returns:

Array[UInt8, _Self.OUTPUT_SIZE]

reset

fn def reset(mut self)

Reset the hash to its initial state.

Args:

  • self (Self)