encodeBase64()function

encodeBase64(input: PossibleBytes, pad = true): string
ParamType
inputPossibleBytes
The string or byte data to encode. required
padunknown
Whether to append = padding characters (defaults to true). Defaults to true
Return
string
The Base64-encoded string.
Throws
RequiredError
If input cannot be converted to a byte sequence.

Encode a string or binary data to a Base64 string.

Examples

encodeBase64("abc") // "YWJj"