public uint FileHash(string filePath)
{
uint result = 5381;
int HASH_TRANS_SIZE = 0x400, charIndex = 0, len;
byte charCode;
len = filePath.Length;
if (len >= HASH_TRANS_SIZE) {
return 0;
}
filePath = filePath.ToLower();
if (len > 0) {
while (charIndex < len) {
charCode = (byte)filePath[charIndex];
if (charCode != 46 && charCode != 92) {
result = charCode + 33 * result;
}
++charIndex;
}
}
return result;
}