Module crypto

Module crypto 

Source
Expand description

Cryptographic operations for Seq

These functions are exported with C ABI for LLVM codegen to call.

§API

# SHA-256 hashing
"hello" crypto.sha256                    # ( String -- String ) hex digest

# HMAC-SHA256 for webhook verification
"message" "secret" crypto.hmac-sha256    # ( String String -- String ) hex signature

# Timing-safe comparison
sig1 sig2 crypto.constant-time-eq        # ( String String -- Bool )

# Secure random bytes
32 crypto.random-bytes                   # ( Int -- String ) hex-encoded random bytes

# UUID v4
crypto.uuid4                             # ( -- String ) "550e8400-e29b-41d4-a716-446655440000"

Functions§

patch_seq_constant_time_eq
Timing-safe string comparison
patch_seq_hmac_sha256
Compute HMAC-SHA256 of a message with a key
patch_seq_random_bytes
Generate cryptographically secure random bytes
patch_seq_sha256
Compute SHA-256 hash of a string
patch_seq_uuid4
Generate a UUID v4 (random)