Fletcher 32 Algorithm: The basic idea behind the algorithm that makes it better than the simple checksums we looked at in class is that it accumulates a second sum by adding the intermediary sums...

Fletcher 32 Algorithm: The basic idea behind the algorithm that makes it better than the simple checksums we looked at in class is that it accumulates a second sum by adding the intermediary sums along the way. Here is a description of how the Fletcher32 algorithm works, along with an example: Given a string as input, 'hello' for example, the algorithm does the following: 1. For each character in the string, find the ord() value of the character 2. Create a list, call it aList, of these ord() values. So 'hello' would give you: aList = [104, 101, 108, 108, 111) because ord('h') = 104, ord('e') = 101, etc. 3. Create a new list, call it bList, and initialize it with a o in it. 4. For each value in aList, insert a value to the blist that is the sum of the aList value with all of the values prior to it in the aList (mod the sum by 65535). So in our example, we have: bList = [0, 104, 205, 313, 421, 532] because: O was in the list initially 104 is the first value in a List 205 = (104 + 101) $ 65535 313 = (104 + 101 + 108) 65535 421 = (104 + 101 + 108 + 108) $ 65535 532 = (104 + 101 + 108 + 108 + 111) 65535 5. Sum all of the values in blist to get your checksum value. So we would have: checksum = 0 + 104 + 205 + 313 + 421 + 532 = 1575 6. The last part of the algorithm uses Bitwise arithmetic to further manipulate the sum value. Bitwise arithmetic translates integers into binary numbers and manipulates the bits in the number. The two bitwise operators that are used in the Fletcher 32 algorithm are Bitwise OR and Bitwise left shift. You can find a description of all Bitwise operators here: https://www.programiz.com/python-programming/operators#bitwise In the Fletcher algorithm we perform the following Bitwise operations on the final checksum:
May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here