mirror of
https://github.com/hanzoai/jose.git
synced 2026-09-24 17:00:01 +00:00
Correct subpath names that otherwise lead users to unexported entries, and fix examples, links, and missing descriptions in published JSDoc. Use instanceof in JWKS recovery examples so strict TypeScript can narrow caught errors. Signed-off-by: Filip Skokan <[email protected]>
1.2 KiB
1.2 KiB
Function: decode()
💗 Help the project
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'.
Parameters
| Parameter | Type | Description |
|---|---|---|
input |
string | Uint8Array |
Base64URL encoded input, as a string or its UTF-8 bytes. |
Returns
The decoded bytes.
Example
const decoded = jose.base64url.decode('SGVsbG8gV29ybGQh')
Throws
When the input is not correctly Base64URL encoded. Standard Base64 input
(i.e. containing + or /) is rejected.