Skip to main content
crc32 - node__zlib.d.ts - Node documentation
function crc32

Usage in Deno

```typescript import { crc32 } from "node:node__zlib.d.ts"; ```
crc32(
data:
string
| Buffer
| ArrayBufferView
,
value?: number,
): number
Computes a 32-bit [Cyclic Redundancy Check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) checksum of `data`. If `value` is specified, it is used as the starting value of the checksum, otherwise, 0 is used as the starting value.

Parameters

data:
string
| Buffer
| ArrayBufferView
When `data` is a string, it will be encoded as UTF-8 before being used for computation.
optional
value: number
An optional starting value. It must be a 32-bit unsigned integer. @default 0

Return Type

number
A 32-bit unsigned integer containing the checksum.