Skip to content

English wiki

ps147258 edited this page Mar 24, 2018 · 2 revisions

Welcome to the FileHash wiki!

About the FileHash.
The current programming language versions are C++Builder and Delphi version of the source code in Embarcadero RAD Studio 10 Seattle, which uses JVCL components.
All hash except CRC32 uses the algorithm in Delphi with MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA512_224, and SHA512_256.

FileHash main from

Download .exe file of the compiled FileHash:

The JVCL components used are JvFilenameEdit, TJvgProgress, and TJvThread.
Uses JVCL 3.49 and CompleteJCL 2.7 Build 5676 form SourceForge project JVCL .

  • JvFilenameEdit
    More convenient file path edit box and support for file selection dialogs.
  • TJvgProgress
    More detailed and instant reaction progress bar.
  • TJvThread
    Simple to use thread.

These examples demonstrate how to use threads to handle multiple hash calculations in Delphi and C++Builder, and simply uses a secondary buffer memory space.

Using TJvThread, Note that WaitFor cannot be used in Execute of JvThread, because “Application.HandleMessage” is called internally. Since “Application.HandleMessage” is handled by the main thread, “TJvThread.WaitFor” can only be used in the main thread.

Since it is processed in the background thread, it can be modified to:

  while JvThread.OneThreadIsRunning do
    Sleep(1); // Optimize the response based on the performance modification value.

Although used in the source code:

  repeat
    Sleep(1);
  until JvThread.Terminated;

So, that’s it.

Main thread to start hash calculation // Message process
.. // …
.. Sub thread to start // Here is multi-thread of hash calculation.
.. While if not set terminated do
.. {
…. Read file data
…. Call hash calculate thread and execution at the same time.
…. [
…… Hash thread CRC // Here is multi-thread of hash calculation.
…… Hash thread MD5 // Here is multi-thread of hash calculation.
…… // …
…. ]
…. Wait all hash multi process to end
.. }
.. Sub thread to end
.. // …
Main thread to end hash calculation // Message process

Clone this wiki locally