// Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial, // reflected. For speed, this requires that a not be zero. constfn multmodp(a: u32, mut b: u32) -> u32 { letmut m = 1 << 31; letmut p = 0;
loop { if (a & m) != 0 {
p ^= b; if (a & (m - 1)) == 0 { break;
}
}
m >>= 1;
b = if (b & 1) != 0 {
(b >> 1) ^ CRC32_LSB_POLY as u32
} else {
b >> 1
};
}
/* CRC32 */ for chunk in data.chunks(buf_size) { let crc3 = crc32(crc0, chunk); let op = crc32_combine_gen(chunk.len() as _); let crc4 = crc32_combine_op(crc1, crc3, op);
crc1 = crc32(crc1, chunk);
assert_eq!(crc1, crc4);
}
crc2 = crc32(crc2, &data);
assert_eq!(crc1, crc2);
let combine1 = crc32_combine(crc1, crc2, data.len() as _); let combine2 = crc32_combine(crc1, crc1, data.len() as _);
assert_eq!(combine1, combine2);
// Fast CRC32 combine. let op = crc32_combine_gen(data.len() as _); let combine1 = crc32_combine_op(crc1, crc2, op); let combine2 = crc32_combine_op(crc2, crc1, op);
assert_eq!(combine1, combine2);
let combine1 = crc32_combine(crc1, crc2, data.len() as _); let combine2 = crc32_combine_op(crc2, crc1, op);
assert_eq!(combine1, combine2);
true
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.