skip to main | skip to sidebar

Umut Tezduyar's Blog

The content on this site represents my own personal opinions and thoughts at the time of posting, and does not reflect those of my employer's in any way.

Sunday, April 20, 2008

Fletcher Checksum C# Algorithm


protected virtual void CalculateFletcherChecksum(byte[] bytes)
{
   byte c0 = 0, c1 = 0;
   int count = 0;
   for (count = 0; count < bytes.Length; count++)
   {
      c1 += (c0 += bytes[count]);
   }
   bytes[bytes.Length - 2] = (byte)((c0 - c1) & 0xFF);
   bytes[bytes.Length - 1] = (byte)((c1 - 2 * c0) & 0xFF);
}

2 comments Links to this post
Labels: Toolbox
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

1986

1986

Archive

  • ►  2009 (3)
    • ►  December (1)
      • Support Google Chrome
    • ►  April (2)
      • Arm Cortex M3 If-then (IT) instruction
      • Special Control Register that controls the ARM Cor...
  • ▼  2008 (6)
    • ►  July (2)
      • How to enable tab key navigation in a Mac OS X dia...
      • How to reverse a linked list (3 different ways)
    • ►  June (2)
      • How to optimize html pages if your target is slow ...
      • C# Circular Buffer - First in first out (Not threa...
    • ▼  April (1)
      • Fletcher Checksum C# Algorithm
    • ►  March (1)
      • How to send an SMS with an AT command
  • ►  2006 (1)
    • ►  November (1)
      • Sample usage of fetchmail with gmail
  • ►  2005 (2)
    • ►  August (1)
      • WYSIWYG Progress Circle for .Net Framework (C#)
    • ►  April (1)
      • Gradient Panel C# Control (Inherits System.Windows...

Labels

  • .Net Framework (2)
  • Arm (2)
  • C# (2)
  • Embedded Programming (2)
  • Engineering (1)
  • Instruction Set (1)
  • Toolbox (6)