UNPKG

@gleif-it/did-webs-ts

Version:
10 lines (9 loc) 377 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.base64UrlToBytes = void 0; const base64UrlToBytes = (b64url) => { const base64 = b64url.replace(/-/g, '+').replace(/_/g, '/'); const binaryStr = atob(base64); return new Uint8Array([...binaryStr].map((char) => char.charCodeAt(0))); }; exports.base64UrlToBytes = base64UrlToBytes;