mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Update H3 documentation (and minor style nits.)
This commit is contained in:
parent
529d120376
commit
a6d7b7856e
1 changed files with 31 additions and 29 deletions
12
src/H3.h
12
src/H3.h
|
@ -49,9 +49,9 @@
|
|||
// hash a substring of the data. Hashes of substrings can be bitwise-XOR'ed
|
||||
// together to get the same result as hashing the full string.
|
||||
// Any number of hash functions can be created by creating new instances of H3,
|
||||
// with the same or different template parameters. The hash function is
|
||||
// randomly generated using bro_random(); you must call init_random_seed()
|
||||
// before the H3 constructor if you wish to seed it.
|
||||
// with the same or different template parameters. The hash function
|
||||
// constructor takes a seed as argument which defaults to a call to
|
||||
// bro_random().
|
||||
|
||||
|
||||
#ifndef H3_H
|
||||
|
@ -62,8 +62,8 @@
|
|||
// The number of values representable by a byte.
|
||||
#define H3_BYTE_RANGE (UCHAR_MAX+1)
|
||||
|
||||
template<class T, int N> class H3 {
|
||||
T byte_lookup[N][H3_BYTE_RANGE];
|
||||
template <typename T, int N>
|
||||
class H3 {
|
||||
public:
|
||||
H3(T seed = bro_random())
|
||||
{
|
||||
|
@ -111,6 +111,8 @@ public:
|
|||
|
||||
return result;
|
||||
}
|
||||
private:
|
||||
T byte_lookup[N][H3_BYTE_RANGE];
|
||||
};
|
||||
|
||||
#endif //H3_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue