Base64 encode a javascript object

From String to Base-64

var obj = {a: 'a', b: 'b'};
var encoded = btoa(JSON.stringify(obj))

To decode back to actual

var actual = JSON.parse(atob(encoded))

For reference look here.

https://developer.mozilla.org/en/docs/Web/API/WindowBase64/Base64_encoding_and_decoding

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)