encodeBase64URL()function
encodeBase64URL(input: PossibleBytes, pad = false): string
| Param | Type | |
|---|---|---|
input | PossibleBytes | The string or byte data to encode. required |
pad | unknown | Whether to append = padding characters (defaults to false). Defaults to false |
| Return | |
|---|---|
string | The Base64URL-encoded string. |
| Throws | |
|---|---|
RequiredError | If input cannot be converted to a byte sequence. |
Encode a string or binary data to a URL-safe Base64 string.
Examples
encodeBase64URL("abc") // "YWJj"