35 #ifndef FFUZZY_FFUZZY_H
36 #define FFUZZY_FFUZZY_H
61 #define FFUZZY_SPAMSUM_LENGTH 64
64 #define FFUZZY_MIN_BLOCKSIZE 3
70 #define FFUZZY_MIN_MATCH 7
480 const char *s1,
size_t s1len,
481 const char *s2,
size_t s2len,
482 unsigned long block_size
int ffuzzy_compare_digest_near_lt(const ffuzzy_digest *d1, const ffuzzy_digest *d2)
Compare two fuzzy hashes assuming second block size is double as first one.
int ffuzzy_digestcmp(const ffuzzy_digest *d1, const ffuzzy_digest *d2)
Compare two ffuzzy_digest values.
int ffuzzy_compare_digest(const ffuzzy_digest *d1, const ffuzzy_digest *d2)
Compare two fuzzy hashes and compute similarity score.
bool ffuzzy_blocksize_is_near(unsigned long block_size1, unsigned long block_size2)
Determines whether given block sizes are "near".
int ffuzzy_score_strings(const char *s1, size_t s1len, const char *s2, size_t s2len, unsigned long block_size)
Compute partial similarity score for given two block strings and block size.
#define FFUZZY_SPAMSUM_LENGTH
Maximum length for the digest block.
Definition: ffuzzy.h:61
int ffuzzy_score_cap(int s1len, int s2len, unsigned long block_size)
Retrieve score cap for given block lengths and the block size.
int ffuzzy_digestcmp_blocksize_n(const ffuzzy_digest *d1, const ffuzzy_digest *d2)
Compare two ffuzzy_digest values by whether block sizes are "natural" and block size values...
int ffuzzy_compare(const char *str1, const char *str2)
Compute similarity score for given ssdeep hash strings.
int ffuzzy_score_cap_1(int minslen, unsigned long block_size)
Retrieve score cap for given block length and size.
bool ffuzzy_blocksize_is_far_le(unsigned long block_size1, unsigned long block_size2)
Determines whether given ordered block sizes "far" enough.
int ffuzzy_compare_digest_near(const ffuzzy_digest *d1, const ffuzzy_digest *d2)
Compare two fuzzy hashes assuming two block sizes of given hashes are "near".
bool ffuzzy_blocksize_is_valid(unsigned long block_size)
Determines whether given block size is valid to use in libffuzzy.
bool ffuzzy_pretty_digest(char *buf, size_t buflen, const ffuzzy_digest *digest)
Convert ffuzzy_digest to the string.
The type to store ssdeep digest after parsing.
Definition: ffuzzy.h:113
bool ffuzzy_digest_is_natural_buffer(const ffuzzy_digest *digest)
Determines whether digest blocks are valid and "natural".
bool ffuzzy_digest_is_valid_lengths(const ffuzzy_digest *digest)
Determines whether block lengths of given digest are valid.
size_t len2
Digest length for second block of the digest.
Definition: ffuzzy.h:115
bool ffuzzy_digest_is_valid_buffer(const ffuzzy_digest *digest)
Determines whether digest blocks are valid.
int ffuzzy_compare_digest_near_eq(const ffuzzy_digest *d1, const ffuzzy_digest *d2)
Compare two fuzzy hashes assuming two block sizes are same.
unsigned long block_size
Block size of the ssdeep digest.
Definition: ffuzzy.h:116
bool ffuzzy_read_digest(ffuzzy_digest *digest, const char *s)
Read ssdeep digest from the string.
int ffuzzy_digestcmp_blocksize(const ffuzzy_digest *d1, const ffuzzy_digest *d2)
Compare two ffuzzy_digest values by block sizes.
bool ffuzzy_blocksize_is_natural(unsigned long block_size)
Determines whether given block size is "natural".
bool ffuzzy_digest_is_natural(const ffuzzy_digest *digest)
Determines whether given digest is valid and "natural".
bool ffuzzy_digest_is_valid(const ffuzzy_digest *digest)
Determines whether given digest is valid.