1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
#pike __REAL_VERSION__ 
#pragma strict_types 
 
//! Some non-cryptographic checksums. 
 
//! @decl int(0..) crc32(string(8bit) data, void|int(0..) seed) 
//! 
//!   This function calculates the standard ISO3309 Cyclic Redundancy 
//!   Check. 
//! 
//!   @param seed 
//!   Can be fed with the result of the previous invocation to chain on new 
//!   data.   Defaults to zero on virgin runs. 
 
//! @decl int(0..) adler32(string(8bit) data, void|int(0..) seed) 
//! 
//!   This function calculates the Adler-32 Cyclic Redundancy Check. 
//! 
//!   @param seed 
//!   Can be fed with the result of the previous invocation to chain on new 
//!   data.   Defaults to zero on virgin runs. 
 
 
#if constant(Gz.crc32) 
constant crc32 = Gz.crc32; 
constant adler32 = Gz.adler32; 
#endif 
 
//! @decl int(0..) crc32c(string(8bit) data, void|int(0..) seed) 
//! 
//!   This function calculates the Castagnoli CRC, CRC32C. Hardware 
//!   optimized on Intel CPUs with SSE 4.2. 
//! 
//!   @param seed 
//!   Can be fed with the result of the previous invocation to chain on new 
//!   data.   Defaults to zero on virgin runs. 
 
 
#if constant(Nettle.crc32c) 
constant crc32c = Nettle.crc32c; 
#endif