Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function encode(opString)
- {
- opString != undefined ? (str = opString) : (str = str);
- var _loc3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var _loc1;
- var _loc5;
- var _loc2 = 0;
- for (var _loc4 = ""; str.length >= _loc2 + 3; _loc4 = _loc4 + (_loc3.charAt((_loc1 & 16515072) >> 18) + _loc3.charAt((_loc1 & 258048) >> 12) + _loc3.charAt((_loc1 & 4032) >> 6) + _loc3.charAt(_loc1 & 63)))
- {
- _loc1 = (str.charCodeAt(_loc2++) & 255) << 16 | (str.charCodeAt(_loc2++) & 255) << 8 | str.charCodeAt(_loc2++) & 255;
- } // end of for
- if (str.length - _loc2 > 0 && str.length - _loc2 < 3)
- {
- _loc5 = Boolean(str.length - _loc2 - 1);
- _loc1 = (str.charCodeAt(_loc2++) & 255) << 16 | (_loc5 ? ((str.charCodeAt(_loc2) & 255) << 8) : (0));
- _loc4 = _loc4 + (_loc3.charAt((_loc1 & 16515072) >> 18) + _loc3.charAt((_loc1 & 258048) >> 12) + (_loc5 ? (_loc3.charAt((_loc1 & 4032) >> 6)) : ("=")) + "=");
- } // end if
- return (_loc4);
- } // End of the function
- encode("{\"login\":\"login\",\"pass\":\"pass\",\"server\":\"127.0.0.1\"}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement