- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Fletcher’s Checksum

Fletcher checksum is an error – detection technique that uses two checksums to determine single-bit errors in a message transmitted over network channels. It is a block code technique that was devised by John G. Fletcher in 1970s at Lawrence Livermore Labs, USA.

The checksums are created based on the data values in the data blocks to be transmitted and appended to the data. When the receiver gets this data, the checksums are re-calculated and compared with the existing checksums. A non-match indicates an error.

The error-detection capabilities of this method is nearly same as that of Cyclic Redundancy Check (CRC) but requires much less computational effort.

## Versions of Fletcher’s Checksum

There are three popular algorithms of Fletcher’s checksum −

**Fletcher – 16**− The data word is divided into 8-bit blocks. Then, two 8-bit checksums are computed and are appended to form a 16-bit Fletcher checksum.**Fletcher – 32**− The data word is divided into 16-bit blocks. Two 16-bit checksums are computed and are appended to form a 32-bit Fletcher checksum.**Fletcher – 64**− The data word is divided into 32-bit blocks. Two 32-bit checksums are computed and are appended to form a 32-bit Fletcher checksum.

## Algorithm for Computing Fletcher’s Checksum

INPUT : data blocks of equal sizes, 𝑏1,𝑏2………… 𝑏𝑛 OUTPUT : two checksums, 𝑐ℎ𝑒𝑐𝑘𝑠𝑢𝑚1 and 𝑐ℎ𝑒𝑐𝑘𝑠𝑢𝑚2, of 1 byte each

Step 1) Initialize partial sums, and sums, 𝑐_{1}=0 and 𝑐_{2}=0

Step 2) For each data block, 𝑏_{𝑖}

- i. Add 𝑏
_{𝑖}to 𝑐_{1} - ii. Add updates value of 𝑐
_{1}to 𝑐_{2}

Step 3) Compute checksums,

- 𝑐ℎ𝑒𝑐𝑘𝑠𝑢𝑚
_{1}= 𝑐_{1 }𝑀𝑂𝐷 256 and 𝑐ℎ𝑒𝑐𝑘𝑠𝑢𝑚_{2}= 𝑐_{2 }𝑀𝑂𝐷 256

Step 4) Append checksums, 𝑐ℎ𝑒𝑐𝑘𝑠𝑢𝑚_{1} and 𝑐ℎ𝑒𝑐𝑘𝑠𝑢𝑚_{2}, to the data blocks, 𝑏_{1},𝑏_{2}………… 𝑏_{𝑛}

## Example of Computation of Fletcher’s Checksum

Let there be five data blocks, 163, 200, 19, 74 and 88. The computations are −

Block Number Data Block c_{1}c_{2}- - 0 0 1 163 163 163 2 200 363 526 3 19 382 908 4 74 456 1364 5 88 544 1908

𝑐ℎ𝑒𝑐𝑘𝑠𝑢𝑚_{1 }= 544 𝑀𝑂𝐷 256 = 34

𝑐ℎ𝑒𝑐𝑘𝑠𝑢𝑚_{2 }= 1908 𝑀𝑂𝐷 256 = 123

- Related Questions & Answers
- Implementing Checksum Using Java
- What is the difference between Checksum and CRC?
- Create an aggregate checksum of a column in MySQL
- How to get the Checksum of a Byte Array in Java?
- Find yesterday’s, today’s and tomorrow’s date in Python
- 1's Complement vs 2's Complement
- Difference between char s[] and char *s in C
- Sort an arrays of 0’s, 1’s and 2’s using C++
- Sort an arrays of 0’s, 1’s and 2’s using Java
- Difference Between Prim’s and Kruskal’s Algorithm
- Construct DFA of alternate 0’s and 1’s
- What's the Kotlin equivalent of Java's String[]?
- kasai’s Algorithm
- Manacher’s Algorithm
- Fleury’s Algorithm