-
Notifications
You must be signed in to change notification settings - Fork 30
/
hash.h
57 lines (50 loc) · 1.09 KB
/
hash.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* @file hash.h
*
* @author hutusi ([email protected])
*
* @brief Hash functions.
*
* @date 2019-07-26
*
* @copyright Copyright (c) 2019, hutusi.com
*
*/
#ifndef RETHINK_C_HASH_H
#define RETHINK_C_HASH_H
/**
* @brief Calculate a char's hash.
*
* @param pointer The char address.
* @return unsigned int The hash.
*/
unsigned int hash_char(void *pointer);
/**
* @brief Calculate a integer's hash.
*
* @param pointer The integer address.
* @return unsigned int The hash.
*/
unsigned int hash_int(void *pointer);
/**
* @brief Calculate a pointer of object's hash.
*
* @param object The pointer of object.
* @return unsigned int The hash.
*/
unsigned int hash_object(void *object);
/**
* @brief Calculate a string's hash.
*
* @param string The string.
* @return unsigned int The hash.
*/
unsigned int hash_string(void *string);
/**
* @brief Calculate a text's hash.
*
* @param text The text.
* @return unsigned int The hash.
*/
unsigned int hash_text(void *text);
#endif /* #ifndef RETHINK_C_HASH_H */