1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:24:58 +00:00

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
parent 545d8336b8
commit 1e820385d9
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();