CRC-32/ISO-HDLC checksum
0

Configure Feed

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

TypeScript 100.0%
4 1 0

Clone this repository

https://git.vm.fail/mary.my.id/pkg-crc32 https://git.vm.fail/did:plc:aickducfqst5bfipb5gdida7
ssh://git@knot1.tangled.sh:2222/mary.my.id/pkg-crc32 ssh://git@knot1.tangled.sh:2222/did:plc:aickducfqst5bfipb5gdida7

For self-hosted knots, clone URLs may differ based on your setup.


README.md

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);
	}
}