cookfp man page
cookfp — calculate file fingerprint
cookfp [ option... ][ filename... ]
The cookfp program is used to calculate the fingerprints of files. A fingerprint is a hash of the contents of a file. The default fingerprint is cryptographically strong, so the probability of two different files having the same fingerprint is less than 1 in 2**200.
The fingerprint is based on Dan Berstien <email@example.com> public domain fingerprint 0.50 beta package 930809, posted to the alt.sources newsgroup. This program produces identical results; the expected test results were generated using Dan's package.
The fingerprint is a base-64-sanely-encoded fingerprint of the input. Imagine this fingerprint as something universal and permanent. A fingerprint is 76 characters long, containing the following:
A Snefru-8 (version 2.5, 8 passes, 512->256) hash. (Derived from the Xerox Secure Hash Function.)
An MD5 hash, as per RFC 1321. (Derived from the RSADSI MD5 Message-Digest Algorithm.)
A CRC checksum, as in the new cksum utility.
Length modulo 2^40.
The output format is not expected to be compatible with anything. However, options are available to produce the purported output of Merkle's snefru program, the purported output of RSADSI's mddriver -x, or the purported output of the POSIX cksum program.
If no files are named as input, the standard input will be used. The special file name “-” is understood to mean the standard input.
The following options are understood:
Print the CRC32 checksum and length of the named file(s).
Print a condensed form of the fingerprint (obtained by performing a CRC32 checksum on the full fingerprint described above - a definite overkill). This is an 8-digit hexadecimal number, useful for generating unique short identifiers out of long names. The first character is forced to be a letter (g-p), so there is no problem in using the output as a variable name.
Provide some help with using the cookfp program.
Print the RSA Data Security, Inc. MD5 Message-Digest Algorithm hash of the named file(s).
Print the Snefru hash of the named file(s), derived from the Xerox Secure Hash Function.
Print the version of the cookfp program being executed.
All other options will produce a diagnostic error.
Portions of this program are derived from sources from other people, sometimes with liberal copyrights, and sometimes in the public domain. These include:
- Dan Bernstien
See common/fp/README for details.
- Gary S Brown.
See common/fp/crc32.c for details.
- RSA Data Security, Inc.
See common/fp/md5.c for details.
- Xerox Corporation
See common/fp/snefru.c for details.
In addition to the above copyright holders, there have been numerous authors and contributors, see the named files for details. Files names are relative to the root of the cook distribution.