2009-11-14 15:14:55 +00:00
|
|
|
#ifndef HASHUTIL_H
|
|
|
|
#define HASHUTIL_H
|
|
|
|
|
2010-04-28 18:19:25 +00:00
|
|
|
#include "mdfour.h"
|
2009-12-05 13:09:21 +00:00
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
struct file_hash
|
|
|
|
{
|
|
|
|
uint8_t hash[16];
|
|
|
|
uint32_t size;
|
|
|
|
};
|
|
|
|
|
2010-07-20 22:12:02 +00:00
|
|
|
unsigned hash_from_string(void *str);
|
2010-07-20 22:12:17 +00:00
|
|
|
unsigned hash_from_int(int i);
|
2009-11-14 15:14:55 +00:00
|
|
|
int strings_equal(void *str1, void *str2);
|
2009-12-05 13:09:21 +00:00
|
|
|
int file_hashes_equal(struct file_hash *fh1, struct file_hash *fh2);
|
2009-11-14 15:14:55 +00:00
|
|
|
|
2010-04-27 20:43:51 +00:00
|
|
|
#define HASH_SOURCE_CODE_OK 0
|
|
|
|
#define HASH_SOURCE_CODE_ERROR 1
|
|
|
|
#define HASH_SOURCE_CODE_FOUND_DATE 2
|
|
|
|
#define HASH_SOURCE_CODE_FOUND_TIME 4
|
2010-04-25 15:03:23 +00:00
|
|
|
|
2010-04-27 20:43:51 +00:00
|
|
|
int hash_source_code_string(
|
|
|
|
struct mdfour *hash, const char *str, size_t len, const char *path);
|
|
|
|
int hash_source_code_file(struct mdfour *hash, const char *path);
|
2010-04-25 13:44:18 +00:00
|
|
|
|
2009-11-14 15:14:55 +00:00
|
|
|
#endif
|