std.digest.crc

Cyclic Redundancy Check (32-bit) implementation.

More...

Public Imports

std.digest
public import std.digest;
Undocumented in source.

Members

Aliases

CRC32
alias CRC32 = CRC!(32, 0xEDB88320)

Template API CRC32 implementation. See std.digest for differences between template and OOP API.

CRC32Digest
alias CRC32Digest = WrapperDigest!CRC32

OOP API CRC32 implementation. See std.digest for differences between template and OOP API.

CRC64ECMA
alias CRC64ECMA = CRC!(64, 0xC96C5795D7870F42)

Template API CRC64-ECMA implementation. See std.digest for differences between template and OOP API.

CRC64ECMADigest
alias CRC64ECMADigest = WrapperDigest!CRC64ECMA

OOP API CRC64-ECMA implementation. See std.digest for differences between template and OOP API.

CRC64ISO
alias CRC64ISO = CRC!(64, 0xD800000000000000)

Template API CRC64-ISO implementation. See std.digest for differences between template and OOP API.

CRC64ISODigest
alias CRC64ISODigest = WrapperDigest!CRC64ISO

OOP API CRC64-ISO implementation. See std.digest for differences between template and OOP API.

crcHexString
alias crcHexString = toHexString!(Order.decreasing)
alias crcHexString = toHexString!(Order.decreasing, 16)

producing the usual CRC32 string output.

Functions

crc32Of
ubyte[4] crc32Of(T data)

This is a convenience alias for std.digest.digest using the CRC32 implementation.

crc64ECMAOf
ubyte[8] crc64ECMAOf(T data)

This is a convenience alias for std.digest.digest using the CRC64-ECMA implementation.

crc64ISOOf
ubyte[8] crc64ISOOf(T data)

This is a convenience alias for std.digest.digest using the CRC64-ISO implementation.

Structs

CRC
struct CRC(uint N, ulong P)

Generic Template API used for CRC32 and CRC64 implementations.

Detailed Description

This module conforms to the APIs defined in std.digest. To understand the differences between the template and the OOP API, see std.digest.

This module publicly imports std.digest and can be used as a stand-alone module.

Note: CRCs are usually printed with the MSB first. When using std.digest.toHexString the result will be in an unexpected order. Use std.digest.toHexString's optional order parameter to specify decreasing order for the correct result. The crcHexString alias can also be used for this purpose.

Meta

Authors

Pavel "EvilOne" Minayev, Alex Rønne Petersen, Johannes Pfau

References: Wikipedia on CRC

Standards

Implements the 'common' IEEE CRC32 variant (LSB-first order, Initial value uint.max, complement result)

CTFE: Digests do not work in CTFE