If you are building any kind of login system or you need file signatures in Delphi XE5 Firemonkey you may be looking for an MD5 hash function. MD5 hash functionality ships with Delphi XE5 in the Indy component set. An MD5 hash is basically a string of unique characters that will represent the data you give it whether it is a password or an MP3 file. However, the code to access it is rather long which is where this library called hashutil comes in. The library should be cross platform and run on Windows, Android, IOS, and OSX. It provides some wrapper functions around the MD5 hash functionality which makes it easier to use. There is a function for a straight string, a stream, and a file. These three functions cover a lot of the usage and formats that you might need an MD5 hash for. You could for example get the MD5 hash for a list of MP3 files and use the hash as a fingerprint to see if there are duplicate files.. You could also create an MD5 hash of a password so that you are not storing the actual password in clear text. Here is a sample function: function MD5(S: String): String;
with TIdHashMessageDigest5.Create do
Result := HashStringAsHex(S);
end; Head over and download the hashutil library code snippet for use in your projects.
FMXExpress.com has over 700 tips and tricks for building cross platform apps on Android, IOS, OSX, Windows, and Linux with a single codebase and single UI using the FireMonkey framework found in Delphi and C++Builder.
FMXExpress covers top cross platform secrets for FireMonkey in C++Builder and Delphi XE5, XE6, XE7, XE8, Seattle, Berlin, Tokyo, Rio, and Sydney.