Exemple #1
0
 public static uint Crc32(byte[] buffer)
 {
     if (buffer == null)
     {
         throw new ArgumentNullException("buffer");
     }
     return(Crc.Crc32(buffer, 0, buffer.Length));
 }
Exemple #2
0
        //查找资源信息
        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));
        }
Exemple #3
0
 public static uint Crc32(string str)
 {
     return(Crc.Crc32(str, "utf-8"));
 }
Exemple #4
0
 public static uint Crc32(string str, string encoding)
 {
     byte[] bytes = Encoding.GetEncoding(encoding).GetBytes(str);
     return(Crc.Crc32(bytes));
 }