base64url
Library (@digitalcredentials/base64url-universal)
Universal
A Javascript isomorphic library for
base64url
text encoding, for Node.js, React Native and browsers
Table of Contents
Background
Encode/Decode input according to the "Base64url Encoding" format as specified in JSON Web Signature (JWS) RFC7517. A URL safe character set is used and trailing '=', line breaks, whitespace, and other characters are omitted.
Security
TBD
Install
- Node.js 16+ is recommended.
NPM
To install via NPM:
npm install @digitalcredentials/base64url-universal
Development
To install locally (for development):
git clone https://github.com/digitalcredentials/base64url-universal.git
cd base64url-universal
npm install
Usage
-
base64url-universal
-
encode(input) ⇒
string
⏏ -
decode(input) ⇒
Uint8Array
⏏
-
encode(input) ⇒
string
⏏
encode(input) ⇒ Encodes input according to the "Base64url Encoding" format as specified in JSON Web Signature (JWS) RFC7517. A URL safe character set is used and trailing '=', line breaks, whitespace, and other characters are omitted.
Kind: Exported function
Returns: string
- the encoded value.
Param | Type | Description |
---|---|---|
input |
Uint8Array | string
|
the data to encode. |
Uint8Array
⏏
decode(input) ⇒ Decodes input according to the "Base64url Encoding" format as specified in JSON Web Signature (JWS) RFC7517. A URL safe character set is used and trailing '=', line breaks, whitespace, and other characters are omitted.
Kind: Exported function
Returns: Uint8Array
- the decoded value.
Param | Type | Description |
---|---|---|
input | string |
the data to decode. |
Contribute
PRs accepted.
If editing the Readme, please conform to the standard-readme specification.
License
MIT License © 2023 Digital Credentials Consortium.