Lines Matching full:str

36  * @param str a string of input data
37 * @param n the number of bytes in @p str
39 * @return the numeric hash associated with @p str
41 typedef uint32_t (*sys_hash_func32_t)(const void *str, size_t n);
48 * `float`, `double`, or `void *`, and that the alignment of @p str agrees
53 * @param str a string of input data
54 * @param n the number of bytes in @p str
56 * @return the numeric hash associated with @p str
58 static inline uint32_t sys_hash32_identity(const void *str, size_t n) in sys_hash32_identity() argument
62 return *(uint8_t *)str; in sys_hash32_identity()
64 return *(uint16_t *)str; in sys_hash32_identity()
66 return *(uint32_t *)str; in sys_hash32_identity()
68 return (uint32_t)(*(uint64_t *)str); in sys_hash32_identity()
73 __ASSERT(false, "invalid str length %zu", n); in sys_hash32_identity()
86 * @param str a string of input data
87 * @param n the number of bytes in @p str
89 * @return the numeric hash associated with @p str
95 uint32_t sys_hash32_djb2(const void *str, size_t n);
100 * @param str a string of input data
101 * @param n the number of bytes in @p str
103 * @return the numeric hash associated with @p str
109 uint32_t sys_hash32_murmur3(const void *str, size_t n);
114 * @param str a string of input data
115 * @param n the number of bytes in @p str
117 * @return the numeric hash associated with @p str
119 static inline uint32_t sys_hash32(const void *str, size_t n) in sys_hash32() argument
122 return sys_hash32_identity(str, n); in sys_hash32()
126 return sys_hash32_djb2(str, n); in sys_hash32()
130 return sys_hash32_murmur3(str, n); in sys_hash32()