MCPcopy Create free account
hub / github.com/F-Stack/f-stack / crcspeed16little_init

Function crcspeed16little_init

app/redis-6.2.6/src/crcspeed.c:52–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void crcspeed16little_init(crcfn16 crcfn, uint16_t table[8][256]) {
53 uint16_t crc;
54
55 /* generate CRCs for all single byte sequences */
56 for (int n = 0; n < 256; n++) {
57 table[0][n] = crcfn(0, &n, 1);
58 }
59
60 /* generate nested CRC table for future slice-by-8 lookup */
61 for (int n = 0; n < 256; n++) {
62 crc = table[0][n];
63 for (int k = 1; k < 8; k++) {
64 crc = table[0][(crc >> 8) & 0xff] ^ (crc << 8);
65 table[k][n] = crc;
66 }
67 }
68}
69
70/* Reverse the bytes in a 64-bit word. */
71static inline uint64_t rev8(uint64_t a) {

Callers 2

crcspeed16big_initFunction · 0.85
crcspeed16native_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected