8 lines
240 B
JavaScript
8 lines
240 B
JavaScript
export class Base64Url {
|
|
encode(str) {
|
|
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
|
|
function toSolidBytes(match, p1) {
|
|
return String.fromCharCode('0x' + p1);
|
|
}));
|
|
}
|
|
} |