HP3000-L Archives

October 2001, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Gavin Scott <[log in to unmask]>
Reply To:
Gavin Scott <[log in to unmask]>
Date:
Wed, 10 Oct 2001 11:01:37 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (44 lines)
Sathish writes:

> In one of the projects that we are doing we need to compute the checksum
> of a file record.  The intention is to get a number which is
> representative of the record and identify whether the record has changed
> in a subsequent run of the program. Any pointers to the standard
> checksum generation logic will be greatly appreciated.(We intend to
> write the program in Cobol)

Keep in mind that "standard" checksum algorithms like CRC codes were
designed to detect thermal noise in a transmission line, which has different
characteristics than deliberate changes to binary data.  The CRC codes rely
to some degree on the fact that typical transmission line noise comes in
bursts and never changes just one bit, whereas many operations on a database
record might only change a single bit, which would increase the possibility
that the CRC code would miss the "error".  I don't know how likely this is
to be a problem in practice, but it would concern me if I needed to do the
same thing.

A discussion of CRC codes and their design characteristics can be found in
Tanenbaum:

   http://www.amazon.com/exec/obidos/ASIN/0133499456

You should look into the general class of functions known as "message digest
algorithms" which are used in cryptography and which are good enough that
it's basically impossible to come up with a change to the data that doesn't
change the checksum value.  These may be overkill for your application, but
they are explicitly designed to detect any kind of change to digital data.

A good introduction (with C source code) can be found in Schneier:

   http://www.amazon.com/exec/obidos/ASIN/0471117099

For any kind of checksum algorithm, you will most likely find available (and
free) source code implementing the function, but the code is likely to be in
C, and your best bet may be to simply compile the C code as-is and call it
from the COBOL rather than trying to translate the algorithm into COBOL.

G.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2