gleamunison/crypto

Types

pub type CryptoError {
  InvalidInput(reason: String)
}

Constructors

  • InvalidInput(reason: String)

Values

pub fn describe_error(error: CryptoError) -> String

The one place a CryptoError becomes a user sentence. Rendering belongs with the type, not at each call site — inspect output must never reach a user.

pub fn hmac_sha256(
  key: BitArray,
  data: BitArray,
) -> Result(BitArray, CryptoError)
pub fn secure_compare(a: BitArray, b: BitArray) -> Bool

Constant-time comparison (for tag verification).

pub fn to_hex(bytes: BitArray) -> String

Hex-encode raw bytes (no hashing).

✨ Search Document