chksum [options] file1 {file2 file3 ...}
chksum was initially written to offer to OpenVMS Users an exact equivalent tool than what already exists (or available as freeware) under Unix system. However, chksum can be compiled on Unix system and provides the same functionality across platform since the available cksum and sum programs seems to give different results and their options have different meaning.
-b Computes the BSD checksum, computation with BUFSIZ blocks -r Computes the BSD checksum, computation with 1Kb blocks -s 512-byte blocks SYSV compatible -o 1Kb blocks SYSV compatible -c Cyclic Redundancy Check (CRC) checksum and number of bytes (according to IEEE Std 1003.2-1992 and X/Open CAE) -m Compute MD5 checksum of files according to the definition of MD5 in RFC 1321 from April 1992.
Default is -b
unless overwritten by the environment variable CHKSUM_OPTION. This variable
should be set to one of ``b'',``r'',``s'',``o'',``c'' or ``m''.
VMS/Unix Digital Unix Linux ------------------------------------------------ $ chksum -r % sum -r % sum -r $ chksum -o % sum -o % sum --sysv $ chksum -c see below % cksum
There are differences between the natice Digital Unix cksum program and the GNU cksum program. chksum is compatible with the GNU version of cksum.
Options
section.
Currently, only the last version of a file can be checksum-ed under VMS OS.
This return value will produce a VMS cli message which relevance is doubtful AND misleading. We maintained the initial scheme for cross-platform portability reasons i.e. regardless of where you are running chksum, the value returned to the shell can be tested within a script.
Caveat
How did I test this program and what are the caveat ? Well, first, I have tested on both Digital Unix and Linux for consistent results.
Then, I went to the Seti homepage at
http://setiathome.ssl.berkeley.edu/
and looked at the different checksum given in http://setiathome.ssl.berkeley.edu/unix.html
for alpha_openvms_bck.exe downloaded on a Digital Unix machine. I could
reproduce the checksums given there using -m
, -r
and -c
options.
The preceding test failed when the same package was downloaded under an OpenVMS node. U<Don't panic> ! This is normal as explained below.
This missmatch comes from the VMS RMS file attributes and specifically, the missmatch between the 2 OS produced 'Record Format'.
OSF1 downloaded file : Stream_LF, maximum 0 bytes, longest 0 bytes VMS downloaded file : Fixed length 512 byte records
For a fair comparison, you MUST convert your file to Stream_LF format before using chksum. This can be done by using (OpenVMS 6.2 and above) the following command :
$ set file/attribute=RFM:STMLF file.ext
The CRC code has been taken from cksum written by Q. Frank Xia, and Copyright (C) 92, 1995-1999 Free Software Foundation, Inc.
The MD5 checksum has been implemented based on the routines provided in the GNU version of MD5.C, written by Written by Ulrich Drepper and Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This software was otherwise written by Jerome LAURET Copyright (c) 1999-2001 under the terms of the GNU GPL.
If you encounter any problem with this utility (other than IO error), please, send me an Email along with a description of what you did and the file you tried to check. Also, please, send comments/suggestions/flame/blame/curses to me. They are all welcomed and will help other people in future by making this software better.
Email : jlauret@mail.chem.sunysb.edu