3 ms·
Fnv is well-know hashing function, like CRC. Names in the code are not the main problem. 1. Structure of the code is a mess: everything lives in the same names
by wmu 12y ago
Fnv is well-know hashing function, like CRC. Names in the code are not the main problem.
1. Structure of the code is a mess: everything lives in the same namespace, while some stuff could be a private properties of classes/structs.
2. Why structs rather than classes?
3. Why user is forced to use std::string? (template parameter, please)
4. Why user can't plug own hashing function (maybe better or faster)?
5. Author assumed that "unsinged char" has 8 bits - std::uint8_t is the valid type.
6. There is no abstraction for integers encoding, just hard-wired varint encoder.