public static int HashFilename(string input) { if (string.IsNullOrEmpty(input)) return 0; int hash = 0; foreach (char ch in input) hash = hash * 0x25 + char.ToLowerInvariant(ch); return hash; }