comparison dcrypt/misc/checksums/CRC32.d @ 34:b1d9be1b3a34

Added additional overrides to Adler32 and CRC32 in dcrypt.misc.checksums in further hopes of D2 compatibility.
author Thomas Dixon <reikon@reikon.us>
date Thu, 14 May 2009 05:31:58 -0400
parents 21847420b1ac
children
comparison
equal deleted inserted replaced
33:b9f8aa42a547 34:b1d9be1b3a34
77 crc = table[cast(ubyte)(crc ^ i)] ^ (crc >> 8); 77 crc = table[cast(ubyte)(crc ^ i)] ^ (crc >> 8);
78 78
79 return (crc ^ 0xffffffff); 79 return (crc ^ 0xffffffff);
80 } 80 }
81 81
82 /** Play nice with D2's idea of const. */
83 version (D_Version2)
84 {
85 uint compute(string input)
86 {
87 return compute(cast(ubyte[])input);
88 }
89 }
90
82 string name() 91 string name()
83 { 92 {
84 return "CRC32"; 93 return "CRC32";
85 } 94 }
86 95