=head1 NAME chksum - Computes the file checksum of a file or files. chksum [options] file1 {file2 file3 ...} =head1 DESCRIPTION I provides most of the capabilities of the Unix I and I programs. It also implements the MD5 checksum based on the GNU MD5 code implementation all in one package. =head1 Usage I command can be used to compare a suspect file copied or communicated over noisy transmission lines, internet or unpacked from an archive against an exact copy of a trusted file. The comparison made by the command may not be cryptographically secure ; however, it is unlikely that an accidentally damaged file will produce the same checksum as the original file. I was initially written to offer to OpenVMS Users an exact equivalent tool than what already exists (or available as freeware) under Unix system. However, I 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. =head1 Options -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 C<-b> unless overwritten by the environment variable CHKSUM_OPTION. This variable should be set to one of "b","r","s","o","c" or "m". =head1 Equivalences 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 I program and the GNU I program. I is compatible with the GNU version of I. =head1 Limitations The default option is non-portable (depends on your OS BUFSIZ). It has been preserved for backward compatibility purposes only. To change the default option, define the environment variable CHKSUM_OPTION as described in the C section. Currently, only the last version of a file can be checksum-ed under VMS OS. =head1 ReturnValue I returns a EXIT_SUCCESS status if no error was found, each +10 correspond to one file open/close error and +1 for each read-error. =head1 VMSNotes Return value =over 4 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. =back Caveat =over 4 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 C and looked at the different checksum given in C for alpha_openvms_bck.exe downloaded on a Digital Unix machine. I could reproduce the checksums given there using C<-m>, C<-r> and C<-c> options. The preceding test failed when the same package was downloaded under an OpenVMS node. U ! 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 I. This can be done by using (OpenVMS 6.2 and above) the following command : $ set file/attribute=RFM:STMLF file.ext =back =head1 Version&Author This help describes version 1.2* . =over 4 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. =back 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 : C =cut