Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checksum Explanation?

Tags:

checksum

I am currently looking at checksums but am having trouble fully understanding how they work.

FYI, I have been looking at UDP checksums and Internet checksums. I have learned that UDP at the sender side performs 1s complement, however I am unclear as to what 1s complement is.

I have a rough idea of 1s complement being something to do with 'reversing' the values of all 1s and 0s, so that a 1 becomes a 0 and a 0 becomes a 1, but I do not know why this is done in the first place.

Could somebody kindly provide some information about checksums in general?

Thank you.

like image 284
Mus Avatar asked Dec 27 '22 21:12

Mus


1 Answers

Checksum is mostly the hash (a one way encryption function) of some value to make sure that the data is consistent when it gets to the other end. The checksum is taken before the data is sent, then when the data is received at the other, the checksum of the same value is taken again, and matched with the checksum from the sender, if they are the same, then the data is in good state, else we know something is wrong.

Fairly simplified explanation.

like image 81
Tony The Lion Avatar answered Jan 01 '23 10:01

Tony The Lion