summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_inline_hash.x
diff options
context:
space:
mode:
authorvivek <vivek.ellur@samsung.com>2015-04-28 23:33:56 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-05-07 09:53:11 +0200
commit1fdc58a58061f044f5a701f8b96af2eb80027b52 (patch)
treef930f9047dfa3c8dbb84b553dc61be0de14e3117 /src/lib/eina/eina_inline_hash.x
parenteec4a7bd0caa7d52bff6cc524ca12efa16d1445b (diff)
eina: add crc hash function to eina hash module.
Summary: Added eina_hash_crc function in eina hash module to generate hash code using crc-32. Signed-off-by: vivek <vivek.ellur@samsung.com> Reviewers: Sergeant_Whitespace, cedric Subscribers: Sergeant_Whitespace, cedric Differential Revision: https://phab.enlightenment.org/D2273 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_inline_hash.x12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/eina/eina_inline_hash.x b/src/lib/eina/eina_inline_hash.x
index 630e3479ba..71b0208c9c 100644
--- a/src/lib/eina/eina_inline_hash.x
+++ b/src/lib/eina/eina_inline_hash.x
@@ -19,6 +19,8 @@
19#ifndef EINA_INLINE_HASH_X_ 19#ifndef EINA_INLINE_HASH_X_
20#define EINA_INLINE_HASH_X_ 20#define EINA_INLINE_HASH_X_
21 21
22#include "eina_crc.h"
23
22EAPI extern unsigned int eina_seed; 24EAPI extern unsigned int eina_seed;
23 25
24/* 26/*
@@ -150,4 +152,14 @@ eina_hash_murmur3(const char *key, int len)
150 152
151 return _fmix32(h1); 153 return _fmix32(h1);
152} 154}
155
156static inline int
157eina_hash_crc(const char *key, int len)
158{
159 unsigned int crc;
160 unsigned int seed = 0xFFFFFFFF;
161
162 crc = eina_crc(key, len, seed, EINA_TRUE);
163 return (int)crc;
164}
153#endif 165#endif