MCPcopy Create free account
hub / github.com/Moli-X/Resources / cb_encode

Function cb_encode

Script/Parser.js:3026–3038  ·  view source on GitHub ↗
(ccc)

Source from the content-addressed store, hash-verified

3024 return u.replace(re_utob, cb_utob);
3025 };
3026 var cb_encode = function (ccc) {
3027 var padlen = [0, 2, 1][ccc.length % 3],
3028 ord = ccc.charCodeAt(0) << 16
3029 | ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8)
3030 | ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)),
3031 chars = [
3032 b64chars.charAt(ord >>> 18),
3033 b64chars.charAt((ord >>> 12) & 63),
3034 padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
3035 padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
3036 ];
3037 return chars.join('');
3038 };
3039 var btoa = function (b) {
3040 return b.replace(/[\s\S]{1,3}/g, cb_encode);
3041 };

Callers

nothing calls this directly

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected