mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 14:30:36 +00:00
added more examples and references
This commit is contained in:
parent
6bfbc4ed66
commit
912c89a0b9
1 changed files with 19 additions and 0 deletions
|
|
@ -17,6 +17,25 @@ int main()
|
|||
assert(~crc() == 0x1C291CA3);
|
||||
}
|
||||
if (1) {
|
||||
// Optimization of cyclic redundancy-check codes with 24 and 32 parity bits
|
||||
// by G. Castagnoli, S. Brauer and M. Herrmann - 1993
|
||||
// Hamming distance of at least 6 up to a payload of 32736 bits.
|
||||
CODE::CRC<uint32_t> crc(0xC8DF352F);
|
||||
for (uint8_t c: std::string("Hello World!")) crc(c);
|
||||
assert(!crc(uint32_t(0xAB94FCAB)));
|
||||
}
|
||||
if (1) {
|
||||
// Optimization of cyclic redundancy-check codes with 24 and 32 parity bits
|
||||
// by G. Castagnoli, S. Brauer and M. Herrmann - 1993
|
||||
// Hamming distance of at least 5 up to a payload of 65505 bits.
|
||||
CODE::CRC<uint32_t> crc(0xD419CC15);
|
||||
for (uint8_t c: std::string("Hello World!")) crc(c);
|
||||
assert(!crc(uint32_t(0xECFE423E)));
|
||||
}
|
||||
if (1) {
|
||||
// Performance of cyclic redundancy codes for embedded networks
|
||||
// by T. Chakravarty and P. Koopman - 2001
|
||||
// Optimal for payloads <= 64 bits
|
||||
CODE::CRC<uint16_t> crc(0xA8F4);
|
||||
for (uint8_t c: std::string("Hello World!")) crc(c);
|
||||
assert(!crc(uint16_t(0x8FEF)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue