Internet Explorer 10+ // Define the stringĬonsole.log(encodedString) // Outputs: "SGVsbG8gV29ybGQh"Ĭonsole. String += omCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)) Īlso, search for "JavaScript base64 encoding" turns up a lot of other options, and the above was the first one. This._keyStr.charAt(enc3) + this._keyStr.charAt(enc4) This._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + Var chr1, chr2, chr3, enc1, enc2, enc3, enc4 _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", You can probably use both btoa() and atob(), unless you support really outdated browsers.
0 Comments
Leave a Reply. |