src/hash_key.c

changeset 1426
3a89b31f0724
parent 1400
7bc88ae62755
equal deleted inserted replaced
1425:83284b289430 1426:3a89b31f0724
103 key.len = str == NULL ? 0 : strlen(str); 103 key.len = str == NULL ? 0 : strlen(str);
104 cx_hash_murmur(&key); 104 cx_hash_murmur(&key);
105 return key; 105 return key;
106 } 106 }
107 107
108 CxHashKey cx_hash_key_ustr(unsigned const char *str) {
109 CxHashKey key;
110 key.data = str;
111 key.len = str == NULL ? 0 : strlen((const char*)str);
112 cx_hash_murmur(&key);
113 return key;
114 }
115
116 CxHashKey cx_hash_key_cxstr(cxstring str) {
117 return cx_hash_key(str.ptr, str.length);
118 }
119
120 CxHashKey cx_hash_key_mutstr(cxmutstr str) {
121 return cx_hash_key(str.ptr, str.length);
122 }
123
108 CxHashKey cx_hash_key_bytes( 124 CxHashKey cx_hash_key_bytes(
109 const unsigned char *bytes, 125 const unsigned char *bytes,
110 size_t len 126 size_t len
111 ) { 127 ) {
112 CxHashKey key; 128 CxHashKey key;

mercurial