neco_gleam/digest

Types

pub opaque type Digest
pub type Failure {
  InvalidBitSize(bits: Int)
}

Constructors

  • InvalidBitSize(bits: Int)

Values

pub fn sha256(bytes: BitArray) -> Result(Digest, Failure)

Computes SHA-256 for byte-aligned input, returning InvalidBitSize when the input ends between byte boundaries.

pub fn to_bit_array(digest: Digest) -> BitArray

Returns the 32 digest bytes.

pub fn to_hex(digest: Digest) -> String

Returns the digest as 64 lowercase hexadecimal characters.

Search Document