Delphi calculates MD5

Delphi calculates MD5
In cryptography, MD5 (Message Digest Algorithm 5, Message Digest Algorithm 5) is a 128-bit password reduction algorithm, and it is one of the most widely used algorithms today.
One of the most common uses is to check whether the file has not been modified.
One of the best examples of using it is that when we download a file from the Internet, the distributor will provide us with an MD5 hash value so that it can be checked after the download and confirmed that it has not changed.
The MD5 hash is 128 bits long, but is generally read in its 32-bit hexadecimal value.
MD5 function in Delphi
Delphi is not exempted as a programming language, but can create a function that calculates the MD5 of a file.
To perform this function, we will need three units, namely IdHashMessageDigest, idHash and IdGlobal.
In this case, we perform two similar functions, one function calculates MD5 in string form, and the other function calculates MD5 in file form.