Description of The Algorithm
As mentioned above, this algorithm computes a checksum by segmenting the data and adding it to an accumulator that is circular right shifted between each summation. To keep the accumulator within return value bounds, bit-masking with 1's is done.
Example: 4-bit checksum using 4-bit sized segments (big-endian:Endianness)
Loop 1:
checksum: 0000 seg: 1011a) Circular shift checksum:
0000 -> 0000b) Add seg and bitmask:
0000 + 1011 = 1011 -> 1011 & 1111 = 1011Loop 2:
checksum: 1011 seg: 1000a) Circular shift checksum:
1011 -> 1101b) Add seg and bitmask:
1101 + 1000 = 10101 -> 10101 & 1111 = 0101Loop 3:
checksum: 0101 seg: 1110a) Circular shift checksum:
0101 -> 1010b) Add seg and bitmask:
1010 + 1110 = 11000 -> 11000 & 1111 = 1000Checksum: 1000
Read more about this topic: BSD Checksum
Famous quotes containing the words description of the, description of and/or description:
“Everything to which we concede existence is a posit from the standpoint of a description of the theory-building process, and simultaneously real from the standpoint of the theory that is being built. Nor let us look down on the standpoint of the theory as make-believe; for we can never do better than occupy the standpoint of some theory or other, the best we can muster at the time.”
—Willard Van Orman Quine (b. 1908)
“The next Augustan age will dawn on the other side of the Atlantic. There will, perhaps, be a Thucydides at Boston, a Xenophon at New York, and, in time, a Virgil at Mexico, and a Newton at Peru. At last, some curious traveller from Lima will visit England and give a description of the ruins of St. Pauls, like the editions of Balbec and Palmyra.”
—Horace Walpole (17171797)
“Everything to which we concede existence is a posit from the standpoint of a description of the theory-building process, and simultaneously real from the standpoint of the theory that is being built. Nor let us look down on the standpoint of the theory as make-believe; for we can never do better than occupy the standpoint of some theory or other, the best we can muster at the time.”
—Willard Van Orman Quine (b. 1908)