1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:37:34 +00:00

AK: Implement SipHash as the default hash algorithm for most use cases

SipHash is highly HashDoS-resistent, initialized with a random seed at
startup (i.e. non-deterministic) and usable for security-critical use
cases with large enough parameters. We just use it because it's
reasonably secure with parameters 1-3 while having excellent properties
and not being significantly slower than before.
This commit is contained in:
kleines Filmröllchen 2023-09-21 00:14:35 +02:00 committed by Ali Mohammad Pur
parent 5e15c29e22
commit 9a026fc8d5
9 changed files with 282 additions and 11 deletions

View file

@ -14,6 +14,9 @@
namespace AK {
// A map datastructure, mapping keys K to values V, based on a hash table with closed hashing.
// HashMap can optionally provide ordered iteration based on the order of keys when IsOrdered = true.
// HashMap is based on HashTable, which should be used instead if just a set datastructure is required.
template<typename K, typename V, typename KeyTraits, typename ValueTraits, bool IsOrdered>
class HashMap {
private: