Files
zCode-CLI-X/~/.npm-cache/hono@4.12.9@@@1/dist/utils/encode.js
admin 875c7f9b91 feat: Complete zCode CLI X with Telegram bot integration
- Add full Telegram bot functionality with Z.AI API integration
- Implement 4 tools: Bash, FileEdit, WebSearch, Git
- Add 3 agents: Code Reviewer, Architect, DevOps Engineer
- Add 6 skills for common coding tasks
- Add systemd service file for 24/7 operation
- Add nginx configuration for HTTPS webhook
- Add comprehensive documentation
- Implement WebSocket server for real-time updates
- Add logging system with Winston
- Add environment validation

🤖 zCode CLI X - Agentic coder with Z.AI + Telegram integration
2026-05-05 09:01:26 +00:00

30 lines
864 B
JavaScript

// src/utils/encode.ts
var decodeBase64Url = (str) => {
return decodeBase64(str.replace(/_|-/g, (m) => ({ _: "/", "-": "+" })[m] ?? m));
};
var encodeBase64Url = (buf) => encodeBase64(buf).replace(/\/|\+/g, (m) => ({ "/": "_", "+": "-" })[m] ?? m);
var encodeBase64 = (buf) => {
let binary = "";
const bytes = new Uint8Array(buf);
for (let i = 0, len = bytes.length; i < len; i++) {
binary += String.fromCharCode(bytes[i]);
}
return btoa(binary);
};
var decodeBase64 = (str) => {
const binary = atob(str);
const bytes = new Uint8Array(new ArrayBuffer(binary.length));
const half = binary.length / 2;
for (let i = 0, j = binary.length - 1; i <= half; i++, j--) {
bytes[i] = binary.charCodeAt(i);
bytes[j] = binary.charCodeAt(j);
}
return bytes;
};
export {
decodeBase64,
decodeBase64Url,
encodeBase64,
encodeBase64Url
};