(bytes: Uint8Array)
| 31 | } |
| 32 | |
| 33 | function base64UrlEncode(bytes: Uint8Array): string { |
| 34 | let binary = ''; |
| 35 | for (const byte of bytes) binary += String.fromCharCode(byte); |
| 36 | return btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); |
| 37 | } |
| 38 | |
| 39 | function base64UrlDecode(text: string): Uint8Array | null { |
| 40 | try { |
no outgoing calls
no test coverage detected