CRC-32/ISO-HDLC checksum
0

Configure Feed

Select the types of activity you want to include in your feed.

pkg-crc32 / README.md
486 B

crc32#

JSR | source code

CRC-32/ISO-HDLC checksum — the variant used by zip, gzip, PNG, RAR, and most archive formats.

import { crc32 } from '@mary/crc32';

const encoder = new TextEncoder();

// one-shot
crc32(encoder.encode('123456789')); // 0xcbf43926

// incremental — feed the previous result back as the seed
{
	let sum = 0;
	for (const chunk of chunks) {
		sum = crc32(chunk, sum);
	}
}