Like
Install to-base64 as a package?
Copied
npm i @bit/bit.utils.string.to-base64
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
toBase64 (
val:
) : (string | Buffer)
string
encode a string or a buffer to base64
Example
Argument
val:
(string | Buffer)
string or buffer to encode
Returns
string
base64 encoded string
Test Summary
#toBase64() should return a base64 encoded string for string | Pass |
#toBase64() should return a base64 encoded string for buffer | Pass |
#toBase64() should not mutate given reference | Pass |