encodeBase64URL()function

encodeBase64URL(input: PossibleBytes, pad = false): string
ParamType
inputPossibleBytes
The string or byte data to encode. required
padunknown
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"