Answers for "convert json to base 64 data js"

1

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
Posted by: Guest on June-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language