encodeBase64()function
encodeBase64(input: PossibleBytes, pad = true): string
| Param | Type | |
|---|---|---|
input | PossibleBytes | The string or byte data to encode. required |
pad | unknown | 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"