using System.Linq; namespace ColdMint.scripts.utils; /// /// Hash code utils /// 哈希码工具 /// public static class HashCodeUtils { /// /// Gets the hash code for a string /// 获取字符串的哈希码 /// /// ///The input string returns a fixed hash code ///输入的字符串,返回固定的哈希码 /// /// public static uint GetFixedHashCode(string str) { //Turn off overflow checking to improve performance //关闭溢出检查,以提高性能 unchecked { return str.Aggregate(2166136261, (current, c) => (current ^ c) * 16777619); } } }