fingerprintfile(3)

NAME
fingerprintfile - compute the fingerprint of a stream

SYNTAX
#include <fprintfile.h> void fingerprintfile_clear(f);
void fingerprintfile_addn(m,b,len);
void fingerprintfile_add(f,c);
void fingerprintfile_hash(f,h); unsigned int fingerprintfile_fmt(s,h);
unsigned int fingerprintfile_scan(s,h); fingerprintfile *f;
unsigned char c;
unsigned char h[FINGERPRINTFILE_HASHLEN];
unsigned char *b;
int len; char *s;

DESCRIPTION
fingerprintfile computes the fingerprint of a stream of unsigned characters. Nobody knows how to create two files with the same fingerprint. f points to an fingerprintfile structure, which accumulates the fingerprint as data is fed in. Before feeding in any data you must call fingerprintfile_clear(f). Then, for each unsigned character c from the stream, call fingerprintfile_add(f,c). To process an array b of len unsigned characters, call fingerprintfile_addn(m,b,len). This is faster than calling fingerprintfile_add on each character in turn. fingerprintfile_hash(f,h) places the resulting fingerprint into h, an array of bytes of length FINGERPRINTFILE_HASHLEN. You may not use f after that without again calling fingerprintfile_clear(f). FINGERPRINTFILE_HASHLEN equals 57. fingerprintfile_fmt(s,h) places a readable version of the hash h into the character array s. It returns the number of characters written. If s is zero, fingerprintfile_fmt will not write anything, but it will return the number of characters it would have written. fingerprintfile_scan(s,h) attempts to decipher a readable hash appearing in the character array s. If it fails it returns 0. If it succeeds it places the hash into h, and returns the number of characters read from s. The readable version of a hash takes up exactly 76 characters.

VERSION
fingerprintfile 0.95, 8 July 1993.

DEFINITION
The fingerprint contains four pieces of information: the result of snefrufile, which (through snefru512) computes the Snefru-8 function with code derived from the Xerox Secure Hash Function; the result of md5file, which computes the RSADSI MD5 Message-Digest Algorithm; the result of crc32file, which computes a standard CRC-32; and the number of bytes of the stream, modulo terabytes.

AUTHOR
Placed into the public domain by Daniel J. Bernstein. Note that the libraries used by fingerprintfile are not public-domain.

SEE ALSO
fingerprint(1), crc32file(3), md5file(3), snefrufile(3)