Apero.Crypto.Hash (Apero v2.1.0)

Copy Markdown View Source

Cryptographic hashing functions.

Provides SHA-256, SHA-512, MD5, and HMAC hashing, all returning lowercase hex-encoded strings.

Examples

iex> Apero.Crypto.Hash.sha256("hello")
"2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"

Summary

Functions

HMAC-SHA256 (hex encoded).

MD5 hash (hex encoded). NOTE: MD5 is cryptographically broken — only for checksums.

SHA-256 hash (hex encoded).

SHA-512 hash (hex encoded).

Functions

hmac(secret, data)

@spec hmac(binary(), binary()) :: binary()

HMAC-SHA256 (hex encoded).

md5(data)

@spec md5(binary()) :: binary()

MD5 hash (hex encoded). NOTE: MD5 is cryptographically broken — only for checksums.

sha256(data)

@spec sha256(binary()) :: binary()

SHA-256 hash (hex encoded).

sha512(data)

@spec sha512(binary()) :: binary()

SHA-512 hash (hex encoded).