@assemblyvoting/av-crypto

中文文档
1.4.0发布于 2026/10/22MITTypeScriptCommonJS近 30 天下载 1962

The JavaScript based cryptographic library of Assembly Voting

原始使用文档
文档目录4 节
  1. Installing
  2. Usage
  3. Testing
  4. Publishing

Assembly Voting JavaScript Crypto

Code coverage

This is the main cryptographic library used in Assembly Voting's JavaScript applications.

Installing

Install directly from Github into your Javascript project.

npm install @assemblyvoting/av-crypto

Usage

This library exposes a number of high level flows, which can be used to "encrypt a vote", "verify a signature", "decrypt a vote", etc. These are all exposed in an instance of AVCrypto, which can be constructed providing an elliptic curve name. Currently supported curves are secp256k1, secp256r1, secp384r1 and secp521r1. Example:

import { AVCrypto } from "@assemblyvoting/av-crypto"

crypto = new AVCrypto("secp256k1")
private_key = "c5ff9a9bf89ff96b03a1af5ac04e46ded73ecfe19ea104c6ad9e0f7c42e0584e"
crypto.sign("hello", private_key)
# => "<32 byte hex>,<32 byte hex>"

Testing

To run tests:

yarn run test

To generate HTML documentation for external usage:

yarn run docs

Publishing

Publishing it done automatically by the pipeline. Check the pipeline to see if the publish was successful. Remember to update the package.json version.

版本与发布记录

@assemblyvoting/av-crypto 共发布 13 个版本,首次发布于 2025/08/04;过去 12 个月发布了 6 个版本。

版本发布日期距今
1.4.0latest2026/10/2217 天前
1.3.02026/06/294 个月前
1.2.22026/06/234 个月前
1.2.12026/06/224 个月前
1.1.2-beta.1beta2026/06/224 个月前
1.1.12026/03/048 个月前

其他发布通道:next → 1.2.0-rc.3,beta → 1.1.2-beta.1。

关于 @assemblyvoting/av-crypto 的常见问题

@assemblyvoting/av-crypto 是什么?

The JavaScript based cryptographic library of Assembly Voting

如何安装 @assemblyvoting/av-crypto?

在项目目录运行 npm install @assemblyvoting/av-crypto,或使用 pnpm add / yarn add / bun add。

@assemblyvoting/av-crypto 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@assemblyvoting/av-crypto 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@assemblyvoting/av-crypto 可以商用吗?

@assemblyvoting/av-crypto 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@assemblyvoting/av-crypto 的下载量有多少?

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

@assemblyvoting/av-crypto 还在维护吗?

最新版本 1.4.0 发布于 2026/10/22(17 天前);至今共发布 13 个版本,其中过去 12 个月发布了 6 个;首次发布于 2025/08/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。