Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Celerity.Hashing/StringFnV1AHasher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ public int Hash(string key)
uint hash = offsetBasis;
foreach (char c in key)
{
// Convert char to its lower byte; you may also want to consider
// encoding specifics if you deal with non-ASCII characters.
// Fold only the low byte of each UTF-16 code unit. Characters that share a
// low byte but differ in their high byte (i.e., U+0100 and above) collide here; use
// StringFnV1AFullHasher when that distinction matters.
Comment thread
Copilot marked this conversation as resolved.
hash ^= (byte)(c & 0xFF);
hash *= fnvPrime;
}
Expand Down
Loading