Search results
Results from the WOW.Com Content Network
cksum is a command in Unix and Unix-like operating systems that generates a checksum value for a file or stream of data. The cksum command reads each file given in its arguments, or standard input if no arguments are provided, and outputs the file's 32-bit cyclic redundancy check (CRC) checksum and byte count. [1]
The effect of a checksum algorithm that yields an n-bit checksum is to map each m-bit message to a corner of a larger hypercube, with dimension m + n. The 2 m + n corners of this hypercube represent all possible received messages. The valid received messages (those that have the correct checksum) comprise a smaller set, with only 2 m corners.
BSD checksum (Unix) 16 bits sum with circular rotation SYSV checksum (Unix) 16 bits sum with circular rotation sum8 8 bits sum Internet Checksum: 16 bits sum (ones' complement) sum24 24 bits sum sum32 32 bits sum fletcher-4: 4 bits sum fletcher-8: 8 bits sum fletcher-16: 16 bits sum fletcher-32: 32 bits sum Adler-32: 32 bits sum xor8: 8 bits ...
So, the simple checksum is computed by adding together all the 8-bit bytes of the message, dividing by 255 and keeping only the remainder. (In practice, the modulo operation is performed during the summation to control the size of the result.) The checksum value is transmitted with the message, increasing its length to 137 bytes, or 1096 bits.
C class code for CRC checksum calculation with many different CRCs to choose from; CRC catalogues ... Algorithm 4 was used in Linux and Bzip2.
An Adler-32 checksum is obtained by calculating two 16-bit checksums A and B and concatenating their bits into a 32-bit integer. A is the sum of all bytes in the stream plus one, and B is the sum of the individual values of A from each step. At the beginning of an Adler-32 run, A is initialized to 1, B to 0.
Initialize checksum to 0; For each byte of the input stream Perform 16-bit bitwise right rotation by 1 bit on the checksum; Add the byte to the checksum, and apply modulo 2 ^ 16 to the result, thereby keeping it within 16 bits; The result is a 16-bit checksum; The above algorithm appeared in Seventh Edition Unix.
The method used to compute the checksum is defined in RFC 768, and efficient calculation is discussed in RFC 1071: Checksum is the 16-bit ones' complement of the ones' complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.