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]>
998 B
998 B
Function: encode()
💗 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.
â–¸ encode(input): string
Encodes an input using Base64URL with no padding.
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 |
Input to encode, as a string or as bytes. Strings are encoded as UTF-8 first. |
Returns
string
The Base64URL encoded, unpadded, representation of the input.
Example
const encoded = jose.base64url.encode('Hello World!')