(buffer: Uint8Array)
| 19 | * Encode a Uint8Array to base64url string (URL-safe base64) |
| 20 | */ |
| 21 | export function encodeBase64Url(buffer: Uint8Array): string { |
| 22 | return Buffer.from(buffer) |
| 23 | .toString('base64') |
| 24 | .replaceAll('+', '-') |
| 25 | .replaceAll('/', '_') |
| 26 | .replaceAll('=', '') |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Decode a base64 string to a Uint8Array |
no outgoing calls
no test coverage detected