Add ndpi_hll_reset() API call

Fixes bug in ndpi_data_window_average() with zero points
This commit is contained in:
Luca Deri
2020-07-15 10:30:45 +02:00
parent 91d132ea3d
commit 9f3e3e8456
3 changed files with 13 additions and 1 deletions
+4
View File
@@ -67,6 +67,10 @@ void hll_destroy(struct ndpi_hll *hll) {
hll->registers = NULL;
}
void hll_reset(struct ndpi_hll *hll) {
memset(hll->registers, 0, hll->size);
}
static __inline void _hll_add_hash(struct ndpi_hll *hll, u_int32_t hash) {
u_int32_t index = hash >> (32 - hll->bits);
u_int8_t rank = _hll_rank(hash, hll->bits);