I'm trying to get hashes for 200 files, size is different for all of them (from 100 bytes to 10GB).
The main problem im facing, that md5 is not working for file, size of which is greater than 3GB, just giving me OutOfMemoryException
.
So what im trying to do, is to Hash one file, than hash another, than another (something like if private bool GenerateHash(String Path)
is busy, than wait, if not than continue, and also i want to be able to hash file which size is greater than 4GB (My System Specs is 4930k and 32GB Ram).
I've done it on linux via Terminal, got all the hashes, but unable to do same thing on Windows.
Currently moving all my stuff from server to home PC, and don't want to download same files or files which are bigger (checking hash and size)
Any suggestions?
Update: Here is the code to hash file (Compiling as x32 and running x64 Box)
public void HashFile(String FPath)
{
using (var md5 = MD5.Create())
{
using (var stream = File.OpenRead(FPath))
{
String ComputedHash = BitConverter.ToString(md5.ComputeHash(stream)).Replace("-", String.Empty).ToLower();
WriteToFile(FPath + " " + ComputedHash);
}
}
}