looking for sysv sum(1) algorithm
Thaddeus P. Floryan
thad at public.BTR.COM
Mon Jun 3 16:11:00 AEST 1991
In article <herbie.675920143 at dec07> herbie at dec07.cs.monash.edu.au (Andrew Herbert) writes:
>[...]
>Can anyone tell me where I can find a description of the SysV sum(1)
>checksum algorithm, or some code which implements it? I am using
>SysVR4, but couldn't find anything to do this in the standard libraries.
>[...]
Around mid to late 1987 a program named "vitals" appeared on the net, most
likely comp.sources.misc, which will do what you want. The program works
fine on the following systems I've tested: 3b1 (3.51 & 3.51m), SunOS (4.0.3
and 4.1.1), MightyFrame (CTIX 5.* and 6.*), VAX/VMS (4.7 and 5.*), AmigaDOS
(1.3.*, 2.*), MS-DOS (3.3), PS/2 (A/IX 1.2.1), Mac A/UX (1.* and 2.*), SGI
IRIX (various), and even on HP-UX where it was developed (though I haven't
(yet) seen it as a standard part of HP-UX distribution as its author claims
it would be :-)
Enclosed is the relevant part of the original posting to aid you finding it;
it should be available at ANY archive site. The "sum" result of vitals is
the same as every UNIX "sum" I've tested:
+ Submitted-by: Alan Silverstein <hpda!hpfcla!hpfcdt!ajs>
+ Posting-number: Volume 11, Issue 66
+ Archive-name: vitals
+
+ This program was developed by Hewlett-Packard and will be part of our
+ HP-UX product offering. We have found it useful. It is most useful
+ when most widely and commonly shared, so here it is.
+
+ We have not tested it except on HP-UX, which is mainly AT&T-compatible.
+ However, it should be pretty portable. Caveat emptor. Oh, and the
+ usual disclaimer that I'm not really an official HP spokesperson.
+
+ Alan Silverstein, Hewlett-Packard Systems Software Operation, Fort Collins,
+ Colorado; {ihnp4 | hplabs}!hpfcla!ajs; 303-229-3053; (lat-long on request :-)
and some misc. extractions from the vitals.1 file:
[...]
.SH NAME
vitals \- crc, sum, line, word, and character counts
[...]
.SH DESCRIPTION
.I Vitals
checks data integrity by
computing vital statistics related to the data in the given
file(s) or standard input (by default).
The statistics include a four-digit hex CRC, a 16-bit byte sum (similar
to
.IR sum (1)
without the block count)
[...]
.SH AUTHOR
.I Vitals
was developed by Hewlett-Packard.
.SH "SEE ALSO"
sum(1), wc(1).
Thad Floryan [ thad at btr.com (OR) {decwrl, mips, fernwood}!btr!thad ]
More information about the Comp.unix.programmer
mailing list