MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / crcbrother

Function crcbrother

lib/core/crc.cc:96–109  ·  view source on GitHub ↗

Thanks to user202729 on StackOverflow for miraculously reverse engineering * this. */

Source from the content-addressed store, hash-verified

94/* Thanks to user202729 on StackOverflow for miraculously reverse engineering
95 * this. */
96uint32_t crcbrother(const Bytes& bytes)
97{
98 ByteReader br(bytes);
99
100 uint32_t crc = br.read_8();
101 while (!br.eof())
102 {
103 for (int i = 0; i < 8; i++)
104 crc = (crc & 0x800000) ? ((crc << 1) ^ BROTHER_POLY) : (crc << 1);
105 crc ^= br.read_8();
106 }
107
108 return crc & 0xFFFFFF;
109}

Callers 2

write_sector_dataFunction · 0.85
decodeDataRecordMethod · 0.85

Calls 2

read_8Method · 0.80
eofMethod · 0.45

Tested by

no test coverage detected