hash::crc64 +linux +x86_64

Implements the CRC-64 checksum algorithm. It is a non-cryptographic checksum.



// Undocumented types:
type state;


const ECMA: u64;
const ISO: u64;
const SIZE: size;


let ecma_table: [256]u64;
let iso_table: [256]u64;


fn crc64(*[256]u64) state;
fn memoize(u64, *[256]u64) void;
fn sum64(*hash::hash) u64;


type state[link]

Show undocumented member
type state = struct {
	table: *[256]u64,
	cval: u64,


def ECMA[link]

def ECMA: u64;

ECMA polynomial for CRC-64. Used in ECMA-182 and xz-utils.

def ISO[link]

def ISO: u64;

ISO polynomial for CRC-64. Used in ISO 3309 (high-level data link controls).

def SIZE[link]

def SIZE: size;

The size, in bytes, of a CRC-64 checksum.


let ecma_table[link]

const ecma_table: [256]u64;

Table of memoized values for each byte with the ECMA polynomial.

let iso_table[link]

const iso_table: [256]u64;

Table of memoized values for each byte with the ISO polynomial.


fn crc64[link]

fn crc64(table: *[256]u64) state;

Creates a hash::hash which computes the CRC-64 algorithm. This hash function does not allocate any state, so you do not need to call hash::close when you are done with it.

It takes a table of memoized values for a given polynomail (for example, iso_table or ecma_table); a table for a custom polynomial, populated by memoize function, may also be used.

fn memoize[link]

fn memoize(polynomial: u64, buf: *[256]u64) void;

Populate a user-provided buffer with the memoized values for a custom polynomial.

The user-provided polynomial must be in the reversed form.

fn sum64[link]

fn sum64(h: *hash::hash) u64;

Returns the 64-bit computed CRC.