<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>checksum-error &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/checksum-error/</link>
	<description>Feed of posts on WordPress.com tagged "checksum-error"</description>
	<pubDate>Tue, 29 Dec 2009 13:46:19 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[How to calculate the checksum of data?]]></title>
<link>http://weseetips.com/2008/08/05/how-to-calculate-the-checksum-of-data/</link>
<pubDate>Tue, 05 Aug 2008 17:33:58 +0000</pubDate>
<dc:creator>Jijo.Raj</dc:creator>
<guid>http://weseetips.com/2008/08/05/how-to-calculate-the-checksum-of-data/</guid>
<description><![CDATA[Long back, I own a Cyrix machine and periodically it stops booting by showing the message &#8211; ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignnone size-medium wp-image-11" src="http://weseetips.wordpress.com/files/2008/03/icon_description.jpg?w=166" alt="" width="166" height="32" /></p>
<p><span style="color:#0000ff;">Long back, I own a <strong>Cyrix machine</strong></span> and <span style="color:#0000ff;">periodically it stops booting by showing the message</span> &#8211; &#8220;<span style="color:#0000ff;">Checksum failure</span>&#8220;. I still remember those <span style="color:#0000ff;">long beeps</span>. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Well, <span style="color:#0000ff;">Checksum is digest generated</span> from a long data which can be used to <span style="color:#0000ff;">check the integrity of data</span>.</p>
<p><img class="alignnone size-full wp-image-313" src="http://weseetips.wordpress.com/files/2008/08/checksum.jpg" alt="" width="500" height="407" /></p>
<p>For instance, if you want to know whether your data file is corrupted, generate and keep the checksum and afterwards for verification again generate the checksum and compare. <span style="color:#0000ff;">So how to generate the checksum?</span></p>
<p><img class="alignnone size-medium wp-image-12" src="http://weseetips.wordpress.com/files/2008/03/icon_howcanidoit.jpg?w=220" alt="" width="220" height="32" /><br />
You can use the function &#8211; <span style="color:#0000ff;">CheckSumMappedFile()</span>. <span style="color:#0000ff;">Actually its used to calculate the checksum of mapped file.</span> Well, you <span style="color:#0000ff;">can use it to calculate the checksum of your data too!</span> Just see the code snippet.</p>
<pre>// The data.
char* pString = "Hello";
DWORD HeaderSum = 0;
DWORD Checksum = 0;

// Calculate the checksum.
CheckSumMappedFile( pString,
                    strlen( pString),
                    &#38;HeaderSum,
                    &#38;Checksum );</pre>
<p><img class="alignnone size-medium wp-image-18" src="http://weseetips.wordpress.com/files/2008/03/icon_note.jpg?w=94" alt="" width="94" height="32" /><br />
The <span style="color:#0000ff;">return of the function</span> is <span style="color:#0000ff;">PIMAGE_NT_HEADERS</span> and in this case, it will be 0 and<span style="color:#0000ff;"> just ignore it.</span> Since our data provided is <span style="color:#0000ff;">not a valid PE file, its obvious</span>. If you check the <span style="color:#0000ff;">Checksum variable,</span> you can find it contains a <span style="color:#0000ff;">valid checksum always</span>. So Take care!</p>
<p><img class="alignnone size-medium wp-image-53" src="http://weseetips.wordpress.com/files/2008/03/intermediateseries.jpg?w=248" alt="" width="248" height="32" /><br />
Targeted Audience &#8211; Intermediate.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
