1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:34:57 +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

@ -439,6 +439,11 @@ u32 String::hash() const
return m_data->hash();
}
u32 String::ascii_case_insensitive_hash() const
{
return case_insensitive_string_hash(reinterpret_cast<char const*>(bytes().data()), bytes().size());
}
Utf8View String::code_points() const
{
return Utf8View(bytes_as_string_view());