Files
archive-tools/src/archive/checksums.ts
T
zemion fe578f46bd
Verify / verify (push) Canceled after 0s
Release Archive Tools 0.2.0
2026-09-02 09:34:59 +02:00

18 lines
435 B
TypeScript

import {
crc32 as sharedCrc32,
formatChecksum,
} from "@add-ideas/toolbox-helpers";
import { ARCHIVE_LIMITS } from "./limits";
export function crc32(bytes: Uint8Array): number {
return sharedCrc32(bytes, ARCHIVE_LIMITS.maxExpandedBytes);
}
export function crc32Hex(bytes: Uint8Array): string {
return formatChecksum(crc32(bytes));
}
export function uint32Hex(value: number): string {
return formatChecksum(value >>> 0);
}