Duality.PathHelper.GetFileHash C# (CSharp) Method

GetFileHash() public static method

Calculates a hash value from the full (byte by byte) content of a file.
public static GetFileHash ( string filePath ) : int
filePath string
return int
        public static int GetFileHash(string filePath)
        {
            if (!File.Exists(filePath)) return 0;

            using (BufferedStream stream = new BufferedStream(File.OpenRead(filePath), 512000))
            {
                var sha = MD5.Create();
                byte[] hash = sha.ComputeHash(stream);
                return BitConverter.ToInt32(hash, 0);
            }
        }