Tech Talk: Checksums and CRCs (2024)

Table of Contents
Related Articles Transcript

A checksum is anumerical check value calculated from a larger set of data. A checksum is most often used when sending a packet of data over a network or other communications channel. One checksum formula is a simple addition, with overflow ignored, wherein the bytes of the packet are added together into a variable of a fixed size/width (say, 16 bits) as they are sent. The checksum is typically sent at the end of the packet and used at the receiving end to confirm the integrity of the preceding data.

A CRCor cyclic redundancy checkis based on division instead of addition. The error detection capabilities of a CRC make it a much stronger checksum and, therefore, often worth the price of additional computational complexity.

Embedded software expert Michael Barr discusses the importance of checksums and CRCs, and how you can integrate them into your code.

Download Barr Group'sCRC Code-C (Free)

Related Articles

CRC Series, Part 1: Additive Checksums

CRC Series, Part 2: CRC Mathematics and Theory

CRC Series, Part 3: CRC Implementation Code in C/C++

Transcript

Michael Barr: This morning we’re talking about Checksums and CRCs. A CRC which is short for a Cyclic Redundancy Code is a powerful type of a checksum. A checksum is any sort of a mathematical operation that you can perform on data to make sure that the bits don’t get flipped accidentally when it’s stored in a memory or when it’s transmitted over to a network. A CRC is a particularly powerful type of a checksum, mostly because it’s very difficult to fool a CRC. So, CRCs are widely used. One of the benefits of them is not only are they difficult to fool, but they’re relatively compact most are either 16 or 32 bits, so just taking up two or four bytes of additional storage.

So, you might have a large packet that’s going to go out over to the network like a network packet for the Internet Protocol might be 1500 bytes long. But you only need four additional bytes to store a 32-bit CRC to ensure that the data has not been corrupted. It’s not universally perfect, but mathematically it’s very difficult to fool. There are lots of – CRC is just a general concept. There is lots of – it’s a mathematical process, but there are different specific algorithms or formulas that you can apply based on what’s known as the generator polynomial. And so, one of the standards that’s widely used is what’s called the CRC-32 written like this and that’s the standard CRC-32 meaning 32 bits that is used widely over the internet for ensuring that data is accurate. But there are others as well including 16-bit CRCs and a variety of different generator polynomials and other specific techniques.

One of the things that’s tricky for engineers when you’re going to implement a CRC is that if you’re using a general purpose processor or even a pen and a paper, computing a CRC is complex mathematically, because it operates on something that’s called Modulo-2 addition which is the kind of binary arithmetic. And you can build special dedicated hardware to do this quickly and sometimes you see that. But if you’ve got to write it in your C program or your C++ program for embedded systems it can be tricky and it’s something that you shouldn’t waste your time doing because there are existing solutions for it.

On our website at barrgroup.com, you’ll find three very popular articles about CRCs explaining what they are, how they work and what the property’s protection are. Also, how to implement them in C and along with the how to implement them in C article is resource code that I wrote about 15 years ago and has been used by thousands of embedded software engineers and it’s probably deployed in millions of systems already. And it’s been proven time and time again to implement CRCs of specific polynomials. You can choose the polynomial or change it to your liking. This is easy to use and it’s a good reusable code that’s available for free on our website for your download.

Tech Talk: Checksums and CRCs (2024)
Top Articles
Love You vs. I Love You: What's the Difference?
Define effective digital marketing KPIs to achieve your goals in 2023
Melson Funeral Services Obituaries
Weeminuche Smoke Signal
Songkick Detroit
The Pope's Exorcist Showtimes Near Cinemark Hollywood Movies 20
10000 Divided By 5
Pollen Count Central Islip
12 Best Craigslist Apps for Android and iOS (2024)
Dump Trucks in Netherlands for sale - used and new - TrucksNL
Summer Rae Boyfriend Love Island – Just Speak News
Apus.edu Login
Vermont Craigs List
Xomissmandi
Richland Ecampus
Betaalbaar naar The Big Apple: 9 x tips voor New York City
Sand Dollar Restaurant Anna Maria Island
Essence Healthcare Otc 2023 Catalog
Devotion Showtimes Near Regency Buenaventura 6
Anonib Oviedo
Amelia Chase Bank Murder
Water Temperature Robert Moses
Darrell Waltrip Off Road Center
Harbor Freight Tax Exempt Portal
Gma' Deals & Steals Today
Ullu Coupon Code
The Monitor Recent Obituaries: All Of The Monitor's Recent Obituaries
Roadtoutopiasweepstakes.con
Muma Eric Rice San Mateo
Ny Post Front Page Cover Today
Best Workers Compensation Lawyer Hill & Moin
2008 Chevrolet Corvette for sale - Houston, TX - craigslist
Facebook Marketplace Marrero La
Aliciabibs
Dadeclerk
Sc Pick 4 Evening Archives
Thelemagick Library - The New Comment to Liber AL vel Legis
Low Tide In Twilight Manga Chapter 53
Sdn Fertitta 2024
Foxxequeen
R: Getting Help with R
Rs3 Nature Spirit Quick Guide
R/Gnv
The Blackening Showtimes Near Ncg Cinema - Grand Blanc Trillium
Market Place Tulsa Ok
Definition of WMT
Rubmaps H
Electric Toothbrush Feature Crossword
Syrie Funeral Home Obituary
Latest Posts
Article information

Author: Terrell Hackett

Last Updated:

Views: 6157

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.