HASH01
All functions > BUSINESS_SIMULATIONS > HASH01
Returns a value between 0 and 1 based on the given hashing key.
Syntax
HASH01(hashing_key: VARCHAR) → DOUBLE
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
hashing_key | VARCHAR | Yes | String value to hash (typically user ID or session ID) |
Returns
DOUBLE - Deterministic value in range [0.0, 1.0)
Notes
- Deterministic hash - same key always produces same value
- Uses MD5 hashing internally
- Uniformly distributed across [0.0, 1.0) range
- Useful for A/B testing, sampling, and rollouts
- Each unique key maps to a stable value
- Foundation for other simulation functions (SAMPLE_UNIFORM, PROBABILITY_TO_EVENT)