habitat.utils.checksums¶
Various checksum calculation utilities.
Functions
crc16_ccitt(data) | Calculate the CRC16 CCITT checksum of data. |
fletcher_16(data[, modulus]) | Calculate the Fletcher-16 checksum of data, default modulus 255. |
op_xor | xor(a, b) – Same as a ^ b. |
xor(data) | Calculate the XOR checksum of data. |
- habitat.utils.checksums.crc16_ccitt(data)[source]¶
Calculate the CRC16 CCITT checksum of data.
(CRC16 CCITT: start 0xFFFF, poly 0x1021)
Returns an upper case, zero-filled hex string with no prefix such as 0A1B.
>>> crc16_ccitt("hello,world") 'E408'