@digitalcredentials/base64url-universal

中文文档
2.0.6发布于 2023/12/07BSD-3-ClauseESM + CJS近 30 天下载 9595

Encode/decode "Base64url Encoding" format of JSON Web Signature (JWS) RFC7517.

原始使用文档
文档目录11 节
  1. Table of Contents
  2. Background
  3. Security
  4. Install
  5. NPM
  6. Development
  7. Usage
  8. encode(input) ⇒ string ⏏
  9. decode(input) ⇒ Uint8Array ⏏
  10. Contribute
  11. License

Universal base64url Library (@digitalcredentials/base64url-universal)

Build status NPM Version

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

encode(input) ⇒ string ⏏

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.

ParamTypeDescription
inputUint8Array | stringthe data to encode.

decode(input) ⇒ Uint8Array ⏏

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.

ParamTypeDescription
inputstringthe data to decode.

Contribute

PRs accepted.

If editing the Readme, please conform to the standard-readme specification.

License

MIT License © 2023 Digital Credentials Consortium.

版本与发布记录

@digitalcredentials/base64url-universal 共发布 6 个版本,首次发布于 2022/08/15;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.0.6latest2023/12/072 年前
2.0.52023/12/072 年前
2.0.42023/12/072 年前
2.0.32023/12/072 年前
2.0.22022/08/154 年前
2.0.12022/08/154 年前

关于 @digitalcredentials/base64url-universal 的常见问题

@digitalcredentials/base64url-universal 是什么?

Encode/decode "Base64url Encoding" format of JSON Web Signature (JWS) RFC7517.

如何安装 @digitalcredentials/base64url-universal?

在项目目录运行 npm install @digitalcredentials/base64url-universal,或使用 pnpm add / yarn add / bun add。

@digitalcredentials/base64url-universal 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/digitalcredentials__base64url-universal 是否存在。

@digitalcredentials/base64url-universal 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@digitalcredentials/base64url-universal 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=14。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@digitalcredentials/base64url-universal 可以商用吗?

@digitalcredentials/base64url-universal 使用 BSD-3-Clause 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。另外不得用原作者名义为衍生产品背书。以上为概括,不构成法律意见,请以许可原文为准。

@digitalcredentials/base64url-universal 的下载量有多少?

根据 npm 官方下载统计,@digitalcredentials/base64url-universal 在 2026/10/12 – 2026/11/10 这 30 天内被下载 9,595 次,日均约 320 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@digitalcredentials/base64url-universal 还在维护吗?

最新版本 2.0.6 发布于 2023/12/07(2 年前);至今共发布 6 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/08/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。