Module std.digest.crc
Cyclic Redundancy Check (32-bit) implementation.
| Category | Functions | 
|---|---|
| Template API | CRCCRC32CRC64ECMACRC64ISO | 
| OOP API | CRC32DigestCRC64ECMADigestCRC64ISODigest | 
| Helpers | crcHexStringcrc32Ofcrc64ECMAOfcrc64ISOOf | 
 This module conforms to the APIs defined in std. To understand the
 differences between the template and the OOP API, see std.
 This module publicly imports std and can be used as a stand-alone
 module.
Note
CRCs are usually printed with the MSB first. When using
 std the result will be in an unexpected
 order. Use std's optional order parameter
 to specify decreasing order for the correct result. The crcHexString
 alias can also be used for this purpose.
References
Standards
Implements the 'common' IEEE CRC32 variant (LSB-first order, Initial value uint.max, complement result)
CTFE
Digests do not work in CTFE
Example
//Template API
import stdExample
//OOP API
import stdFunctions
| Name | Description | 
|---|---|
| 
									crc32Of(data)
								 | This is a convenience alias for stdusing the
 CRC32 implementation. | 
| 
									crc64ECMAOf(data)
								 | This is a convenience alias for stdusing the
 CRC64-ECMA implementation. | 
| 
									crc64ISOOf(data)
								 | This is a convenience alias for stdusing the
 CRC64-ISO implementation. | 
Structs
| Name | Description | 
|---|---|
| 
									CRC
								 | Generic Template API used for CRC32 and CRC64 implementations. | 
Aliases
| Name | Type | Description | 
|---|---|---|
| CRC32 | CRC!(32,3988292384L) | Template API CRC32 implementation.
 See stdfor differences between template and OOP API. | 
| CRC32Digest | std | OOP API CRC32 implementation.
 See stdfor differences between template and OOP API. | 
| CRC64ECMA | CRC!(64,-3932672073523589310L) | Template API CRC64-ECMA implementation.
 See stdfor differences between template and OOP API. | 
| CRC64ECMADigest | std | OOP API CRC64-ECMA implementation.
 See stdfor differences between template and OOP API. | 
| CRC64ISO | CRC!(64,-2882303761517117440L) | Template API CRC64-ISO implementation.
 See stdfor differences between template and OOP API. | 
| CRC64ISODigest | std | OOP API CRC64-ISO implementation.
 See stdfor differences between template and OOP API. | 
| crcHexString | toHexString!(Order.decreasing) | producing the usual CRC32 string output. | 
Authors
Pavel "EvilOne" Minayev, Alex Rønne Petersen, Johannes Pfau