#include "footprint.h"
#include <sys/types.h>
#include <string.h>
#include <assert.h>
Include dependency graph for footprint.cc:
Go to the source code of this file.
Defines | |
#define | COMPUTE(var, ch) (var) = (var) << 8 ^ crctab[(var) >> 24 ^ (ch)] |
Functions | |
long | crc (char *s) |
returns crc of string | |
long | crc (char *s, int len) |
returns crc of char array | |
void | cksumblock (FILE *file, u_int32_t &crc) |
checksum block of 512 chars from file | |
char * | encode (u_int32_t v) |
encode a u_int32_t base64 | |
char * | footprint (FILE *file) |
| |
double | footPrintDiff (const char *f1, const char *f2) |
returns equivalence percentage of two footprints | |
Variables | |
const u_int32_t | crctab [] |
footprint.cc -*- c++ -*- Hans-Peter Stoerr Tue Nov 11 2003 Generate footprints of a (large) file that are designed to be hopefully unique, but are easy to calculate and not changed much if some blocks are destroyed in the file. | |
char | basis_64 [] |
|
Definition at line 70 of file footprint.cc. Referenced by cksumblock(), and crc(). |
|
checksum block of 512 chars from file
Definition at line 89 of file footprint.cc. References COMPUTE, and crc(). Referenced by footprint(). |
Here is the call graph for this function:
|
returns crc of char array
Definition at line 81 of file footprint.cc. References COMPUTE. Referenced by readheader(), and writeheader(). |
|
returns crc of string
Definition at line 73 of file footprint.cc. Referenced by cksumblock(). |
|
encode a u_int32_t base64
Definition at line 100 of file footprint.cc. References basis_64. Referenced by footprint(). |
|
footprint is as follows: cksum of first 5 blocks, cksum of last 5 blocks, take 15 blocks equally spaced from the rest of the file and cksum first 5, next 5 and last 5 current length: 32 chars Definition at line 119 of file footprint.cc. References cksumblock(), and encode(). Referenced by correctfile(), main(), and protectfile(). |
Here is the call graph for this function:
|
returns equivalence percentage of two footprints
Definition at line 158 of file footprint.cc. Referenced by correctfile(). |
|
Initial value:
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Definition at line 96 of file footprint.cc. Referenced by encode(). |
|
footprint.cc -*- c++ -*- Hans-Peter Stoerr Tue Nov 11 2003 Generate footprints of a (large) file that are designed to be hopefully unique, but are easy to calculate and not changed much if some blocks are destroyed in the file. Purpose of the footprint is a sanity check whether we are applying error correction to the same file.
Definition at line 15 of file footprint.cc. |