Philipp Dunkel
df2ea49e00
zlib: add crc32c
...
Add zlib.crc32c(data[, value]), which computes the CRC-32C checksum
(Castagnoli polynomial, RFC 3720 section 12.1). CRC-32C has better
error detection properties than the CRC-32 of zlib.crc32() and is the
checksum required by many current protocols, formats and services,
among them:
- iSCSI header and data digests (RFC 7143)
- SCTP packet checksums (RFC 9260)
- iWARP MPA framing (RFC 5044)
- NVMe/TCP header and data digests
- ext4, Btrfs and XFS metadata checksums
- the Snappy framing format
- Apache Kafka record batches
- LevelDB and RocksDB block checksums
- TensorFlow TFRecord files
- Google Cloud Storage and Amazon S3 object checksums
Implementing any of these in JavaScript currently needs a userland
CRC-32C, which is far slower than native code.
The function mirrors zlib.crc32(): it accepts a string (encoded as
UTF-8) or an ArrayBufferView, takes an optional 32-bit unsigned
starting value so a checksum can be continued across chunks, and has a
V8 fast API path.
The checksum is computed by absl::ExtendCrc32c() from the bundled
Abseil, which is already built and linked into node, so this adds no
new dependency and no new checksum implementation. absl_crc32c is
added to the libraries linked with --shared-abseil.
Abseil selects its hardware-accelerated CRC-32C path (SSE4.2 and
PCLMULQDQ on x64, the CRC32 and PMULL extensions on arm64) at compile
time, so with node's default compiler flags the portable table-driven
implementation is used. It runs at about the same speed as zlib.crc32()
(about 6.5 GB/s on a recent x64 machine), while the hardware path
reaches about 38 GB/s. Builds whose target CPU baseline already
includes those instructions get the hardware path without changes.
Enabling it for generic builds is left out on purpose: on x64, Abseil
uses the accelerated code for unrecognized CPUs without a runtime
feature check, so compiling it in unconditionally would fault on CPUs
without SSE4.2.
Signed-off-by: Philipp Dunkel <pip@pipobscure.com >
PR-URL: https://github.com/nodejs/node/pull/66828
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2026-10-20 12:33:08 +00:00
..
2026-10-03 06:40:59 +00:00
2026-10-12 06:41:16 +00:00
2026-10-03 06:41:28 +00:00
2026-10-15 00:52:34 +00:00
2026-10-07 15:38:44 -03:00
2026-10-08 09:58:29 +00:00
2026-10-05 16:47:38 +00:00
2026-10-07 15:39:57 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:39:57 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:39:57 -03:00
2026-10-07 15:39:57 -03:00
2026-10-07 15:39:57 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-09-28 04:22:37 +00:00
2026-09-28 04:22:37 +00:00
2026-09-30 13:30:42 +00:00
2026-10-05 16:47:38 +00:00
2026-10-05 11:25:07 +00:00
2026-10-05 16:47:38 +00:00
2026-09-30 08:25:52 +00:00
2026-10-03 16:24:37 +00:00
2026-10-14 21:09:57 +00:00
2026-10-05 16:47:39 +00:00
2026-09-30 06:51:22 +00:00
2026-09-30 06:51:19 +00:00
2026-10-07 13:36:40 +00:00
2026-10-07 13:36:48 +00:00
2026-10-03 08:32:22 +00:00
2026-10-15 09:46:38 +00:00
2026-10-19 04:04:58 +00:00
2026-09-30 06:51:21 +00:00
2026-10-15 07:52:41 +00:00
2026-10-05 16:47:38 +00:00
2026-10-16 06:40:37 +00:00
2026-10-11 07:07:49 +00:00
2026-10-19 15:51:08 +00:00
2026-10-04 22:38:33 +02:00
2026-10-10 11:21:51 +00:00
2026-10-10 11:21:51 +00:00
2026-10-10 11:21:51 +00:00
2026-10-16 09:48:40 +00:00
2026-10-05 05:16:57 +00:00
2026-10-05 05:16:57 +00:00
2026-10-17 06:47:05 +00:00
2026-10-05 11:25:07 +00:00
2026-10-19 02:34:09 +00:00
2026-09-28 20:12:21 +00:00
2026-09-28 20:12:21 +00:00
2026-10-02 22:33:38 +00:00
2026-09-30 13:29:54 +00:00
2026-10-19 02:34:09 +00:00
2026-10-19 02:34:09 +00:00
2026-10-19 02:34:09 +00:00
2026-10-10 17:56:05 +00:00
2026-10-10 17:56:05 +00:00
2026-09-30 06:51:24 +00:00
2026-10-10 17:56:04 +00:00
2026-10-13 18:55:52 +00:00
2026-10-10 08:29:37 +00:00
2026-09-30 06:51:24 +00:00
2026-09-30 13:29:54 +00:00
2026-09-29 10:27:53 +00:00
2026-10-10 13:02:45 +00:00
2026-09-28 10:40:58 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-12 09:13:52 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-09-29 04:38:26 +00:00
2026-10-15 00:52:34 +00:00
2026-09-27 08:10:01 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-09-30 08:25:50 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-06 11:36:02 +00:00
2026-10-06 11:36:02 +00:00
2026-10-06 11:36:02 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-09-30 08:25:48 +00:00
2026-10-06 17:40:45 +00:00
2026-10-16 09:48:39 +00:00
2026-09-30 08:25:47 +00:00
2026-10-05 11:25:07 +00:00
2026-10-05 05:47:29 +00:00
2026-10-15 07:53:03 +00:00
2026-10-02 17:29:27 +00:00
2026-09-28 23:30:13 +00:00
2026-10-16 09:48:37 +00:00
2026-10-05 21:26:47 +00:00
2026-10-05 21:26:47 +00:00
2026-10-05 21:26:47 +00:00
2026-10-05 21:26:47 +00:00
2026-10-05 21:26:47 +00:00
2026-10-17 09:45:08 +00:00
2026-10-18 06:08:16 +00:00
2026-10-15 00:52:34 +00:00
2026-10-19 14:53:43 +00:00
2026-09-30 17:49:14 +00:00
2026-09-27 08:10:15 +00:00
2026-09-27 08:10:15 +00:00
2026-09-27 08:10:15 +00:00
2026-10-17 00:53:49 +00:00
2026-10-08 20:58:31 +00:00
2026-10-15 07:53:03 +00:00
2026-10-13 13:33:55 +00:00
2026-10-05 16:47:38 +00:00
2026-10-19 02:34:09 +00:00
2026-10-18 06:36:43 +00:00
2026-10-03 09:51:01 +00:00
2026-10-13 07:48:55 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-20 11:01:08 +00:00
2026-10-06 17:40:30 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-06 17:17:15 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-17 21:42:53 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-10 17:56:22 +00:00
2026-10-19 21:16:23 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-11 16:10:53 +00:00
2026-10-15 07:53:03 +00:00
2026-10-06 05:55:47 +00:00
2026-10-05 16:47:38 +00:00
2026-10-05 16:47:38 +00:00
2026-10-16 18:06:44 +00:00
2026-10-08 03:54:07 +00:00
2026-10-10 14:36:38 +00:00
2026-10-02 16:56:58 +00:00
2026-10-09 15:53:53 +00:00
2026-10-01 05:39:07 +00:00
2026-10-07 06:41:31 +00:00
2026-10-01 05:39:07 +00:00
2026-10-14 18:50:29 +00:00
2026-10-16 09:48:41 +00:00
2026-09-30 02:42:41 +00:00
2026-10-03 06:41:28 +00:00
2026-10-15 13:26:46 +00:00
2026-10-15 13:26:46 +00:00
2026-10-07 20:01:29 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-10 17:56:14 +00:00
2026-10-10 17:56:23 +00:00
2026-10-15 13:26:50 +00:00
2026-10-15 13:26:46 +00:00
2026-10-07 20:01:29 +00:00
2026-10-15 13:26:45 +00:00
2026-10-15 13:26:49 +00:00
2026-10-10 17:56:19 +00:00
2026-10-07 20:01:31 +00:00
2026-10-15 13:26:46 +00:00
2026-10-10 17:56:18 +00:00
2026-10-10 17:56:09 +00:00
2026-10-15 13:26:46 +00:00
2026-10-10 17:56:10 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-10 17:56:19 +00:00
2026-10-10 17:56:21 +00:00
2026-10-13 15:25:12 +00:00
2026-10-03 06:41:28 +00:00
2026-10-19 12:35:59 +00:00
2026-10-19 02:34:09 +00:00
2026-10-20 04:54:54 +00:00
2026-10-03 09:50:25 +00:00
2026-09-30 08:25:53 +00:00
2026-09-30 08:25:53 +00:00
2026-10-04 22:40:57 +02:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-05 05:17:09 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-19 01:41:35 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-19 02:34:09 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-09-27 09:36:07 +00:00
2026-09-29 23:56:19 +00:00
2026-09-29 23:56:19 +00:00
2026-09-29 23:56:19 +00:00
2026-09-29 23:56:19 +00:00
2026-10-04 19:16:34 +00:00
2026-10-07 13:36:37 +00:00
2026-09-29 23:56:19 +00:00
2026-09-29 17:19:28 +00:00
2026-10-19 17:09:42 +00:00
2026-09-29 17:19:26 +00:00
2026-09-29 17:19:32 +00:00
2026-09-29 17:19:25 +00:00
2026-10-05 07:00:09 +00:00
2026-10-13 10:10:59 +02:00
2026-10-16 16:59:40 +00:00
2026-10-14 08:51:58 +00:00
2026-10-19 02:34:09 +00:00
2026-10-19 02:34:09 +00:00
2026-10-17 17:10:16 +00:00
2026-10-20 12:33:08 +00:00
2026-09-29 21:48:17 +00:00
2026-10-03 07:35:17 +00:00
2026-10-15 07:53:03 +00:00
2026-09-29 21:23:49 +00:00