# @balena/node-crc-utils 中文文档

规范地址：https://npmcn.com/package/%40balena/node-crc-utils/

版本：3\.1\.0
npm 元数据更新时间：2026-06-03T10:29:44.514Z
中文译文更新时间：2026-11-07T15:42:51.277Z
软件包许可：未声明

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40balena/node-crc-utils
原文对照：https://npmcn.com/package/%40balena/node-crc-utils/?lang=original
项目主页：https://github.com/balena-io-modules/node-crc-utils#readme
源码仓库：https://github.com/balena-io-modules/node-crc-utils

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：20.7 kB，4 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- Node.js 要求：\>=16
- 运行依赖：0 个
- 首次发布：2020-11-13T13:07:09.139Z
- 最新版本发布：2026-06-03T09:49:46.859Z
- 近 30 天下载量：21470（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：13（近 12 个月 2 个）

## 中文简介

CRC Utils (英语). 将两个或两个以上的 CRC32 校验和合并为一个新的.

## 安装

```sh
npm install @balena/node-crc-utils
```

也可以使用：`pnpm add @balena/node-crc-utils`、`yarn add @balena/node-crc-utils`、`bun add @balena/node-crc-utils`

## README

# 节点 CRC32 Utils

将两个或两个以上的 CRC32 校验和合并为一个新的.

□ 如何安装 :

```
npm install @balena/node-crc-utils
```

□ 如何建设:

安装标记, 然后复制此 repo

```
npm run build
```

□例为:

```javascript
const crcUtils = require('@balena/node-crc-utils');

// for crc32 checksum use lib: https://github.com/brianloveswords/buffer-crc32/
const crc32 = require('buffer-crc32');

const foo = Buffer.from('foo');
const bar = Buffer.from('bar');

const fooCrc32 = crc32(foo); // <Buffer 8c 73 65 21>
const barCrc32 = crc32(bar); // <Buffer 76 ff 8c aa>
 
const foobar = Buffer.from('foobar');
const foobarCrc32 = crc32(foobar);

crcUtils.ready.then(() => {
    const foobarCrc32Combined = crcUtils.crc32_combine(
        fooCrc32.readUInt32BE(0), 
        barCrc32.readUInt32BE(0), 
        bar.length
    ); 

    // CRC32 are the same but Endianness is prepared for GZIP format
    console.log(foobarCrc32);         // <Buffer 9e f6 1f 95>
    console.log(foobarCrc32Combined); // <Buffer 95 1f f6 9e>
});
```

## 常见问题

### @balena/node-crc-utils 是什么？

CRC Utils \(英语\)\. 将两个或两个以上的 CRC32 校验和合并为一个新的\.

### 如何安装 @balena/node-crc-utils？

在项目目录运行 npm install @balena/node-crc-utils，或使用 pnpm add / yarn add / bun add。

### @balena/node-crc-utils 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/balena\_\_node-crc-utils 是否存在。

### @balena/node-crc-utils 支持 ESM 还是 CommonJS？

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

### @balena/node-crc-utils 需要什么版本的 Node\.js？

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

### @balena/node-crc-utils 可以商用吗？

@balena/node-crc-utils 使用 未声明 许可。package\.json 没有声明许可证。没有许可证的代码默认保留全部权利，商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括，不构成法律意见，请以许可原文为准。

### @balena/node-crc-utils 的下载量有多少？

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

### @balena/node-crc-utils 还在维护吗？

最新版本 3\.1\.0 发布于 2026/06/03（5 个月前）；至今共发布 13 个版本，其中过去 12 个月发布了 2 个；首次发布于 2020/11/13。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

