Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Article Preview


Buy Now

Print:
PDF:

Feature

Data Validation

Using checksums to verify data integrity

Issue: 2.4 (March/April 2004)
Author: Thomas Reed
Author Bio: Thomas Reed has been programming as a hobbyist for more than 20 years, and fell in love with the Mac in 1984.
Article Description: No description available.
Article Length (in bytes): 5,117
Starting Page Number: 34
RBD Number: 2415
Resource File(s): None
Related Link(s): None
Known Limitations: None

Excerpt of article text...

Important data can be damaged in a variety of ways. A crash or damaged hardware can corrupt data on a storage medium, such as a hard drive. Noise in telecommunications hardware can modify data streams. A data entry operator might make a mistake in transcription. The user might even do harm by manually modifying data that is not meant to be edited directly. Because of this, it is often desirable to validate data before using it. In this column, we'll explore different kinds of checksum.

A checksum is extra data transmitted or stored with the original data. The checksum is designed such that some calculation with the data generates a value that can be compared to the checksum. If the calculation result and the checksum do not match, then the data is invalid.

The simplest example of a checksum is a parity bit, something that anyone who used a modem in years past has heard of. The parity bit is a ninth bit associated with every byte. There are two types of parity: even and odd. With even parity, the value of the parity bit is chosen so that, out of all nine bits, an even number of bits have the value 1. For example, with the byte 1111 0000, the parity bit would have a value of 0, while the parity bit associated with the byte 1111 0001 would be 1. Odd parity reverses these rules, requiring that the total number of bits set to 1 be odd.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com