Skip to content

Commit

Permalink
Support for Unicode characters when hashing collision group names.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmalg committed Sep 24, 2020
1 parent caca1e2 commit 18f9db4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions AGXUnity/Utils/Extensions.cs
Expand Up @@ -464,12 +464,10 @@ public static string Color( this string str, Color color )
return GUI.AddColorTag( str, color );
}

public static System.UInt32 To32BitFnv1aHash( this string str )
public static uint To32BitFnv1aHash( this string str )
{
IEnumerable<byte> bytes = str.ToCharArray().Select( Convert.ToByte );

System.UInt32 hash = 2166136261u;
foreach ( byte val in bytes ) {
uint hash = 2166136261u;
foreach ( char val in str ) {
hash ^= val;
hash *= 16777619u;
}
Expand Down

0 comments on commit 18f9db4

Please sign in to comment.