1.1.2
by Joel Rosdahl
Import upstream version 3.0.1 |
1 |
#ifndef HASHUTIL_H
|
2 |
#define HASHUTIL_H
|
|
3 |
||
4 |
#include "mdfour.h" |
|
5 |
#include <inttypes.h> |
|
6 |
||
7 |
struct file_hash |
|
8 |
{
|
|
9 |
uint8_t hash[16]; |
|
10 |
uint32_t size; |
|
11 |
};
|
|
12 |
||
13 |
unsigned int hash_from_string(void *str); |
|
14 |
int strings_equal(void *str1, void *str2); |
|
15 |
int file_hashes_equal(struct file_hash *fh1, struct file_hash *fh2); |
|
16 |
||
17 |
#define HASH_SOURCE_CODE_OK 0
|
|
18 |
#define HASH_SOURCE_CODE_ERROR 1
|
|
19 |
#define HASH_SOURCE_CODE_FOUND_DATE 2
|
|
20 |
#define HASH_SOURCE_CODE_FOUND_TIME 4
|
|
21 |
||
22 |
int hash_source_code_string( |
|
23 |
struct mdfour *hash, const char *str, size_t len, const char *path); |
|
24 |
int hash_source_code_file(struct mdfour *hash, const char *path); |
|
25 |
||
26 |
#endif
|