base64
Validates that a field contains a valid Base64 encoded string.
Options
| Option | Type | Default | Description |
|---|---|---|---|
message | string | locale default | Custom error message |
Playground
Valid values
| Value | Notes |
|---|---|
"SGVsbG8=" | "Hello" in Base64 |
"dGVzdA==" | "test" in Base64 |
Invalid values
| Value | Reason |
|---|---|
"Hello!" | Contains ! which is not a Base64 character |
"SGVsbG8" | Missing required padding (=) |
Notes
- Empty string (
"") always returnsvalid: true. Combine withnotEmptyto require a value.