summaryrefslogtreecommitdiff
path: root/AK/StringHash.h
AgeCommit message (Collapse)Author
2022-01-11AK: Define a traits helper for case-insensitive StringView hashingTimothy Flynn
Currently, we define a CaseInsensitiveStringTraits structure for String. Using this structure for StringView involves allocating a String from that view, and a second string to convert that intermediate string to lowercase. This defines CaseInsensitiveStringViewTraits (and the underlying helper case_insensitive_string_hash) to avoid allocations.
2021-10-25AK: Allow seed value to be specified in string_hash()Leandro Pereira
For some algorithms, such as bloom filters, it's possible to reuse a hash function (rather than having different hashing functions) if the seed is different each time the hash function is used. Modify AK::string_hash() to take a seed parameter, which defaults to 0 (the value the hash value was originally initialized to).
2021-10-06AK: Add missing headersBen Wiederhake
Example failure: IDAllocator.h only pulls in AK/Hashtable.h, so any compilation unit that includes AK/IDAllocator.h without including AK/Traits.h before it used to be doomed to fail with the cryptic error message "In instantiation of 'AK::HashTable<T, TraitsForT, IsOrdered>::Iterator AK::HashTable<T, TraitsForT, IsOrdered>::find(const T&) [with T = int; TraitsForT = AK::Traits: incomplete type 'AK::Traits<int>' used in nested name specifier".
2021-05-14AK: Make StringView::hash() constexprAndreas Kling
This required moving string_hash() to its own header so that everyone can see it.