public static uint Crc32(byte[] buffer) { if (buffer == null) { throw new ArgumentNullException("buffer"); } return(Crc.Crc32(buffer, 0, buffer.Length)); }
//查找资源信息 public static ResInfo FindResInfo(string fileName) { long tmpInfoFlag = 0; if (!mResName2InfoFlagDict.TryGetValue(fileName, out tmpInfoFlag)) { uint tmpResKey = Crc.Crc32(fileName); if (mResKey2InfoFlagDict.TryGetValue(tmpResKey, out tmpInfoFlag)) { mResName2InfoFlagDict.Add(fileName, tmpInfoFlag); } else { Logger.LogError($"资源系统找不到资源 -> {fileName}"); } } return(ResFlag2Info(tmpInfoFlag)); }
public static uint Crc32(string str) { return(Crc.Crc32(str, "utf-8")); }
public static uint Crc32(string str, string encoding) { byte[] bytes = Encoding.GetEncoding(encoding).GetBytes(str); return(Crc.Crc32(bytes)); }