hash::crc64 +linux +x86_64

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

Index

Types

// Undocumented types:
type state;

Constants

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

Globals

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

Functions

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

Types

type state[link]

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

Constants

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.

Globals

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.

Functions

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.