Skip to content

Crypto Domain

The Crypto domain provides essential tools for security and uniqueness.

From generating unguessable UUIDs for database keys to hashing passwords with SHA-256, these functions ensure your program's sensitive data remains secure, unique, and tamper-evident.

aivi
use aivi.crypto

Functions

FunctionExplanation
sha256 text
String -> String
Returns the SHA-256 hash of text encoded as hex.
randomUuid 😦)
Unit -> Effect String
Generates a random UUID v4.
randomBytes n
Int -> Effect Bytes
Generates n random bytes.