API Reference / @evolu/common / Type / Base64Url
Variable: Base64Url
const Base64Url: BrandType<Type<"String", string, string, StringError, string, StringError>, "Base64Url", RegexError<"Base64Url">, StringError>;
Defined in: packages/common/src/Type.ts:1244
URL-safe Base64 string.
A Base64Url
string uses a limited alphabet that is URL-safe:
- Uppercase letters (
A-Z
) - Lowercase letters (
a-z
) - Digits (
0-9
) - Dash (
-
) - Underscore (
_
)
Example
const result = Base64Url.from("abc123_-");
if (result.ok) {
console.log("Valid Base64Url string:", result.value);
} else {
console.error("Invalid Base64Url string:", result.error);
}