AK: Add case-insensitive hashing for the new String classes

Bringing over this functionality from DeprecatedString.
This commit is contained in:
Andreas Kling 2023-09-05 19:55:21 +02:00 committed by Tim Flynn
commit 1e820385d9
Notes: sideshowbarker 2024-07-17 18:46:30 +09:00
4 changed files with 22 additions and 0 deletions

View file

@ -100,6 +100,11 @@ unsigned FlyString::hash() const
return String::fly_string_data_to_hash({}, m_data);
}
u32 FlyString::ascii_case_insensitive_hash() const
{
return case_insensitive_string_hash(reinterpret_cast<char const*>(bytes().data()), bytes().size());
}
FlyString::operator String() const
{
return to_string();