Validation predicates for TypeID components.
Manual validation predicates with zero external dependencies.
Validation predicates for TypeID components. Manual validation predicates with zero external dependencies.
(valid-base32-suffix? s)Check if suffix is valid:
Check if suffix is valid: - Exactly 26 characters - All characters in base32 alphabet - First character <= 7 (prevents overflow)
(valid-prefix? s)Check if prefix matches the TypeID prefix pattern.
Valid prefixes:
Check if prefix matches the TypeID prefix pattern.
Valid prefixes:
- Empty string
- 1-63 lowercase characters matching pattern: [a-z]([a-z_]{0,61}[a-z])?(valid-typeid-string? s)Check if string is a valid TypeID format.
Check if string is a valid TypeID format. - Length between 26 and 90 characters (26 for suffix only, up to 63+1+26 with prefix) - All lowercase
(valid-uuid-bytes? b)Check if bytes represent a valid UUID (exactly 16 bytes).
Check if bytes represent a valid UUID (exactly 16 bytes).
(valid-uuidv7-bytes? b)Stricter validation for generated UUIDs (version 7, variant 10). Checks:
Stricter validation for generated UUIDs (version 7, variant 10). Checks: - Exactly 16 bytes - Version bits (48-51) = 0111 (7) - Variant bits (64-65) = 10
(validate-prefix prefix)Validate prefix, return {:ok prefix} or {:error error-map}.
Validate prefix, return {:ok prefix} or {:error error-map}.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |