function crc64
crc64(
data: Uint8Array,
polynomial?: bigint
): bigint

Calculates CRC64 checksum for the given data.

Uses CRC64-ECMA polynomial (XZ, 7z) by default.

Examples

Example 1

import { assertEquals } from "@std/assert";
import { crc64 } from "@hertzg/crc/crc64";

assertEquals(crc64(new TextEncoder().encode("123456789")), 0x995dc9bbdf1939fan);

Parameters

The data to calculate CRC for

optional
polynomial: bigint = CRC64_ECMA_POLYNOMIAL

The polynomial to use (default: CRC64_ECMA_POLYNOMIAL)

Return Type

bigint

The CRC64 checksum as BigInt

Usage

import { crc64 } from "crc64.ts";