[quote=360969:@Christian Schmitz]MBS HashFile functions can be used on a thread and calculate the hash in a preemptive thread.
This way you can be quicker with multiple threads.[/quote]
Can you explain what you mean by “calculate the hash in a preemptive thread”? Preemptive to what?
[quote=360972:@Christian Schmitz]You can run 8 threads to checksum 8 files individually at the same time.
This can cause 8 CPU cores to be busy.
And your Xojo app still is responsive.[/quote]
OK - understand. Thanks.
[quote=360973:@Mark Pastor]So, for this simple code:
Dim m As New MD5Digest
Dim s As String
m.Process(fileContents)
s = m.Value
How do I prepare/package the file contents for the fileContents variable above?[/quote]
Create a new instance of MD5Digest, then read your file in chunks and call Process on each chunk. When done, read the Value. I do this in Kaju and it is very quick.
I haven’t done a lot of chunking/memoryblock work - would the process look like this…
While not having yet read total file
Read x number of bytes of file as BinaryStream into MemoryBlockA
fileContents (As String) = MemoryBlockA
m.Process(fileContents)
increment position in file
End While
S As String = m.Value