Skip to content

crc32

Compute the CRC32 checksum of a byte buffer.

function crc32(data, previous?): number;

Defined in: src/utils/aws/crc32.ts:56

Compute the CRC32 checksum of a byte buffer.

Parameters

ParameterTypeDefault valueDescription
dataUint8ArrayundefinedThe bytes to checksum.
previousnumber0Optional running CRC from a previous call, for incremental computation over concatenated buffers.

Returns

number

The unsigned 32-bit CRC32 value.

Remarks

Uses the IEEE 802.3 (zlib) polynomial in its reflected form. The result is an unsigned 32-bit integer, matching the value AWS event-stream messages carry in their prelude CRC and message CRC fields.

Example

import { crc32 } from 'composite-voice/utils';

crc32(new TextEncoder().encode('hello')); // 0x3610a686

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency