MCPcopy Create free account
hub / github.com/Rfym21/Qwen2API / customEncode

Function customEncode

src/utils/cookie-generator.js:241–260  ·  view source on GitHub ↗
(data, urlSafe)

Source from the content-addressed store, hash-verified

239
240// ==================== 编码函数 ====================
241
242function customEncode(data, urlSafe) {
243 if (data == null) return '';
244
245 const base64Chars = CUSTOM_BASE64_CHARS;
246
247 let compressed = lzwCompress(data, 6, function(index) {
248 return base64Chars.charAt(index);
249 });
250
251 if (!urlSafe) {
252 switch (compressed.length % 4) {
253 case 1: return compressed + '===';
254 case 2: return compressed + '==';
255 case 3: return compressed + '=';
256 default: return compressed;
257 }
258 }
259
260 return compressed;
261}
262
263// ==================== 辅助函数 ====================

Callers 1

generateCookiesFunction · 0.85

Calls 1

lzwCompressFunction · 0.85

Tested by

no test coverage detected