$functionName(args) syntax.
Identity and Randomness
$uuid()
Generates a random UUID v4 string.string — e.g., 550e8400-e29b-41d4-a716-446655440000
$random(min, max)
Generates a random integer betweenmin and max (inclusive). Defaults to 0-100 when called without arguments.
integer
$randomString(length)
Generates a random string of mixed-case alphanumeric characters.string — e.g., aB3kL9mNpQ7rS2tU
$randomAlphanumeric(length)
Generates a random alphanumeric string. Functionally identical to$randomString.
Returns:
string
$randomEmail()
Generates a random email address.string — e.g., abcdefgh@klmnop.com
Date and Time
$now()
Returns the current UTC date and time in RFC 3339 format.string — e.g., 2026-02-09T15:04:05Z
$timestamp()
Returns the current Unix timestamp in seconds.integer — e.g., 1707490800
$timestampMs()
Returns the current Unix timestamp in milliseconds.integer — e.g., 1707490800000
$date(format)
Returns the current UTC date formatted with a custom Go time layout. Defaults to2006-01-02 (ISO date).
string — e.g., 2026-02-09
Go time layouts use the reference date
Mon Jan 2 15:04:05 MST 2006. For example, {{$date(2006-01-02)}} produces 2026-02-09, and {{$date(01/02/2006)}} produces 02/09/2026.Encoding and Hashing
$base64(value)
Base64-encodes the given string.string — e.g., YWRtaW46c2VjcmV0
$base64Decode(value)
Decodes a Base64-encoded string.
Returns:
string — Returns empty string on decode error.
$md5(value)
Returns the MD5 hex digest of the given string.string — 32-character hex string
$sha256(value)
Returns the SHA-256 hex digest of the given string.
Returns:
string — 64-character hex string
$urlEncode(value)
URL-encodes the given string (percent-encoding).string — e.g., hello+world
$urlDecode(value)
URL-decodes a percent-encoded string.
Returns:
string — Returns the original string on decode error.
Utilities
$json(value)
Passes through the value as-is. Useful for embedding raw JSON strings in variable interpolation contexts.
Returns:
string
$env(name, default)
Reads a system environment variable. Returns the optional default value if the variable is not set or empty.string