docs/util/base64url/functions/decode.md
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.
āø decode(input): Uint8Array
Decodes a Base64URL encoded input.
These functions are exported (as the base64url namespace) from the main 'jose' module entry
point as well as from its subpath export 'jose/base64url'.
| Parameter | Type | Description |
|---|---|---|
input | string | Uint8Array | Base64URL encoded input, as a string or its UTF-8 bytes. |
The decoded bytes.
const decoded = jose.base64url.decode('SGVsbG8gV29ybGQh')
When the input is not correctly Base64URL encoded. Standard Base64 input
(i.e. containing + or /) is rejected.