Fuzzy Hashing API
fuzzy.h
Go to the documentation of this file.
1 #ifndef __FUZZY_H
2 # define __FUZZY_H
3 
4 // Fuzzy Hashing by Jesse Kornblum
5 // Copyright (C) Kyrus 2012
6 //
7 // $Id: fuzzy.h 147 2012-05-25 12:14:50Z jessekornblum $
8 
23 
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 #ifndef _INTTYPES_H_
43 # include <inttypes.h>
44 #endif
45 
46 
47 
58 extern int fuzzy_hash_buf(const unsigned char *buf,
59  uint32_t buf_len,
60  char *result);
61 
62 
75 extern int fuzzy_hash_file(FILE *handle,
76  char *result);
77 
78 
89 extern int fuzzy_hash_filename(const char * filename,
90  char * result);
91 
92 
93 
100 extern int fuzzy_compare(const char *sig1, const char *sig2);
101 
102 
103 
105 #define FUZZY_MAX_RESULT (SPAMSUM_LENGTH + (SPAMSUM_LENGTH/2 + 20))
106 
108 #define SPAMSUM_LENGTH 64
109 
110 
111 // To end our 'extern "C" {'
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 
117 #endif // ifndef __FUZZY_H