convert json to base64 javascript
const json = { "a": 1, "b": 2 }
const string = JSON.stringify(json) // convert Object to a String
const encodedString = btoa(string) // Base64 encode the String
convert json to base64 javascript
const json = { "a": 1, "b": 2 }
const string = JSON.stringify(json) // convert Object to a String
const encodedString = btoa(string) // Base64 encode the String
convert buffer to base64 javascript
var buffer = Buffer.from('hello');//create a buffer of the text "hello"
//right now, buffer == <Buffer 68 65 6c 6c 6f>
var string64 = buffer.toString('base64');
//the .toString operator can set encoding
//string64 == 'aGVsbG8='
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us