From ibmbin Sun Mar 19 19:58:56 EST 1989
Article 1793 of comp.binaries.ibm.pc:
Path: bsu-cs!ibmbin
>From: dhesi@bsu-cs.bsu.edu (Rahul Dhesi)
Newsgroups: comp.binaries.ibm.pc
Subject: v01i217: brik, a general-purpose CRC-32 program v1.0 (part 01/02)
Summary: brik.arc, a general-purpose CRC-32 program v1.0
Message-ID: <6105@bsu-cs.UUCP>
Date: 14 Mar 89 09:01:09 GMT
Sender: news@bsu-cs.UUCP
Followup-To: comp.binaries.ibm.pc.d
Lines: 694
Approved: dhesi@bsu-cs.bsu.edu
X-Submissions-to: ibmpc-binaries@bsu-cs.bsu.edu
X-Questions-to: ibmpc-binaries-request@bsu-cs.bsu.edu

Checksum: 2208628413  (verify or update with "brik")
Posting-number: Volume 01, Issue 217
Originally-from: Rahul Dhesi <dhesi@bsu-cs.bsu.edu>
Submitted-by: Rahul Dhesi <dhesi@bsu-cs.bsu.edu>
Archive-name: brik10/part01

I intend this program to be the standard comp.binaries.ibm.pc mechanism
for automatic verification of incoming articles.  Once it is working,
you will be able to tell tell at a glance whether an incoming posting
in comp.binaries.ibm.pc was received in corrupted form.

The executable for MS-DOS, and C source suitable for System V, 4.3BSD,
VAX/VMS, and MS-DOS/Turbo C, are all in the archive.  However, the
following description is not inside the archive.  Save it separately if
you want to keep it.

This is brik version 1.0, a general-purpose program to generate and
verify 32-bit CRCs in both text and binary files.  The Checksum:
headers in recent comp.binaries.ibm.pc postings contain CRCs that can
be verified or updated with this program.

Advantages of brik over "sum" and most CRC programs I have seen are:

(a) It is freely redistributable and its algorithm is not proprietary
    or licensed by *T&T or anybody else.

(b) It treats text files in a special way.  If you use brik to find
    the CRCs of text files on an MS-DOS system, transfer the files to
    a **IX system with Kermit and use brik on the **IX system, the
    CRC calculated there will match the CRC calculated on the MS-DOS
    system.  However, you can override this feature if you wish, 
    and simply get a binary CRC for every byte in a file.

(c) Brik will also look for a Checksum: header in any text file (or
    C source file) and verify it based on the contents of the file
    that occur *after* the header.  This allows Usenet software to
    change the initial header portion of an article without affecting
    your ability to check the integrity of all lines that occur
    after the Checksum: header.  Brik itself also updates the Checksum:
    header if needed.

(d) Brik can create either text-mode or binary-mode CRCs for a bunch
    of files that can be later checked by brik on the same or a
    different system in one batch.  Although brik isn't designed for this
    purpose, it can be used to keep track of files that change
    unexpectedly (e.g. corrupted filesystems, viruses).  Since brik
    will happily accept filenames on the command line, or from standard
    input, or from a list inside one or more files, it is flexible and
    will work well with other programs such as "find" (**IX) and
    "stuff" (MS-DOS).

To verify the CRC of any comp.binaries.ibm.pc posting from the "rn"
newsreader, type the command:

	 | brik -c

This will feed the current article to "brik -c" as standard input.
Brik will search for the Checksum: header, compare the CRC in that
header with the calculated CRC of the rest of the file, and report any
mismatch.

Rahul Dhesi         UUCP:  <backbones>!{iuvax,pur-ee}!bsu-cs!dhesi
                    ARPA:  dhesi@bsu-cs.bsu.edu
