Calculating Md5 Hash of Big Files
问题 I want to make it very clear and simple. What if I have 1gb ram and I'm trying to calculate md5 hash of 2gb file? Currently, I'm doing it this way: private static string Md5Hash(byte[] input) { byte[] hash = MD5.Create().ComputeHash(input); StringBuilder builder = new StringBuilder(32); foreach(byte b in hash) { builder.Append(b.ToString("X2")); } return builder.ToString(); } // I'm using it like: 'Md5.AsString(File.ReadAllBytes(filePath))' So what are your suggestions? 回答1: Rather than