FurinaImpact/FurinaImpact.Common/Extensions/StringExtensions.cs
2023-12-09 06:45:08 +03:00

14 lines
324 B
C#

namespace FurinaImpact.Common.Extensions;
public static class StringExtensions
{
public static uint GetStableHash(this string str)
{
uint hash = 0;
for (int i = 0; i < str.Length; i++)
{
hash = ((str[i] + 131 * hash) & 0xFFFFFFFF) >> 0;
}
return hash;
}
}