/
Nspection
/
rules-manager-mcp
Обзор
Документация
Войти
/
Nspection
/
rules-manager-mcp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
node_modules/jose/dist/webapi/lib/base64.js
22 строки
673 B
Buglov Evgeny
Первый коммит
27 фев 2026, 21:12
27 фев 2026, 21:12
e51dee3
Код
Авторство
О чём код?
export function encodeBase64(input) { if (Uint8Array.prototype.toBase64) { return input.toBase64(); } const CHUNK_SIZE = 0x8000; const arr = []; for (let i = 0; i < input.length; i += CHUNK_SIZE) { arr.push(String.fromCharCode.apply(null, input.subarray(i, i + CHUNK_SIZE))); } return btoa(arr.join('')); } export function decodeBase64(encoded) { if (Uint8Array.fromBase64) { return Uint8Array.fromBase64(encoded); } const binary = atob(encoded); const bytes = new Uint8Array(binary.length); for (let i = 0; i < binary.length; i++) { bytes[i] = binary.charCodeAt(i); } return bytes; }