@exodus/eip55

中文文档
2.1.1-exodus.1发布于 2024/11/13MITTypeScriptCommonJS近 30 天下载 1.6万

A EIP55 compatible address encoding library

原始使用文档

eip55

build status Version

An EIP55 compatible address encoding library.

Example

let eip55 = require('eip55')

eip55.encode('0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359')
// => 0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359

eip55.verify('0xAcA128edBD274F2aBa534d67DD55Ebf67767B9A5')
// => true

eip55.verify('0xaca128edbd274f2aba534d67dd55ebf67767b9a5')
// => false

// The second argument of verify allows for single case addresses
// In this case it will only verify the leading 0x and length
// therefore the above example returns true instead of false

// lower case
eip55.verify('0xaca128edbd274f2aba534d67dd55ebf67767b9a5', true)
// => true

// upper case
eip55.verify('0xACA128EDBD274F2ABA534D67DD55EBF67767B9A5', true)
// => true

// EIP-1191 chainId support has been added
// pass the optional chainId to get the casing for that network

// Encode for RSK Mainnet (chainId 30) (notice the difference from above)
eip55.encode('0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359', 30)
// => 0xFb6916095cA1Df60bb79ce92cE3EA74c37c5d359

eip55.verify('0xFb6916095cA1Df60bb79ce92cE3EA74c37c5d359')
// => false (we need to pass the chainId)

// Note: the second argument is allowOneCase (default: false)
eip55.verify('0xFb6916095cA1Df60bb79ce92cE3EA74c37c5d359', false, 30)
// => true

License MIT

版本与发布记录

@exodus/eip55 共发布 2 个版本,首次发布于 2023/12/05;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.1.1-exodus.1latest2024/11/132 年前
2.1.1-exodus.02023/12/052 年前

关于 @exodus/eip55 的常见问题

@exodus/eip55 是什么?

A EIP55 compatible address encoding library

如何安装 @exodus/eip55?

在项目目录运行 npm install @exodus/eip55,或使用 pnpm add / yarn add / bun add。

@exodus/eip55 支持 TypeScript 吗?

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

@exodus/eip55 支持 ESM 还是 CommonJS?

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

@exodus/eip55 可以商用吗?

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

@exodus/eip55 的下载量有多少?

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

@exodus/eip55 还在维护吗?

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