Sophisticated crc algorithm

I am trying to find crc that works with the following results. A byte string consists of 2 bytes (i.e. 0xCE1E), and crc is one byte (i.e. 0x03)

byte crc
CE1E 03
CE20 45
CE22 6F
0000 C0
0001 D4
Ffff 95

Can anyone help?

+3
source share
4 answers

Firstly, 4 hexadecimal digits are not 4 bytes. Since all your examples show 4 hexadecimal digits - 2 bytes - I assume you mean 2 bytes.

There are only 65,536 different hash values, that's what you do.

Execute a hash function for all 65536 values โ€‹โ€‹from 0000 to FFFF. What are the results. This table is . It maps the input value to the output value.

, , (65 ), , .

-. , - "" , , .

0000 0001, 0002, 0004, 0008, 0010, 0020, 0040, 0080, 0100, 0200, 0400, 0800, 1000, 2000, 4000 8000, , . .

+4

, (16-) , CRC, . , , CRC.

- ? , / CRC?

: .

+2

CRC - , , , , add subtract XOR. , GF (2):

CE1E % p = 03
CE20 % p = 45
CE22 % p = 6F
0000 % p = C0
0001 % p = D4
FFFF % p = 95

p, 0000% p = c0. (0 p 0 p.) , , (x + input)% p = crc. x c0. , (x + 0001)% p c1. , CRC. , , , , , input = output. .

+2
source

http://www.geocities.com/SiliconValley/Pines/8659/crc.htm#r2

In my inexperienced views, you will have to implement the general crc algorithm and try it with several policies (first try the โ€œpopularโ€ ones mentioned in this article).

edit: after further reading, it seems that you should also consider reverse fields.

0
source

All Articles