MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / compute_crc24

Function compute_crc24

cassandra/segment.py:41–53  ·  view source on GitHub ↗
(data, length)

Source from the content-addressed store, hash-verified

39
40
41def compute_crc24(data, length):
42 crc = CRC24_INIT
43
44 for _ in range(length):
45 crc ^= (data & 0xff) << 16
46 data >>= 8
47
48 for i in range(8):
49 crc <<= 1
50 if crc & 0x1000000 != 0:
51 crc ^= CRC24_POLY
52
53 return crc
54
55
56def compute_crc32(data, value):

Callers 2

encode_headerMethod · 0.85
decode_headerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected