UNPKG

web-enc-at-rest

Version:
13 lines (12 loc) 465 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.base64ToBytes = exports.bytesToBase64 = void 0; function bytesToBase64(array) { return globalThis.btoa(String.fromCharCode(...array)); } exports.bytesToBase64 = bytesToBase64; function base64ToBytes(base64) { const asciiString = globalThis.atob(base64); return new Uint8Array([...asciiString].map(char => char.charCodeAt(0))); } exports.base64ToBytes = base64ToBytes;