pike.git / lib / modules / Crypto.pmod / Checksum.pmod

version» Context lines:

pike.git/lib/modules/Crypto.pmod/Checksum.pmod:1: + #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   Newline at end of file added.