UNPKG

@gleif-it/did-webs-ts

Version:
5 lines (4 loc) 182 B
export const bytesToBase64Url = (bytes) => btoa(Array.from(bytes, (b) => String.fromCharCode(b)).join('')) .replace(/\+/g, '-') .replace(/\//g, '_') .replace(/=+$/, '');