I recently tried this to fix the Classpath in Gradle for compiling and testing. Works for compiling, bombs for the testing though. The Gradle plugin integration using jna-3.2.7 blows up during unit testing when the older API is not loaded. What a mess. At least this snippet should help for other scenarios.

This is the first time I have had to create MD5 hashes for files in C++. I did find a library called POCO that has some very handy classes for doing this. I didn’t want to copy and paste code from work, so I created this simple example for hashing a single file and outputting the MD5 hash in a hex encoded string.

The hashing uses a chunk size of 1 MiB changes so the whole file is not loaded at once.

I will soon create another post on how to do this in Qt5 and post it then, updating this post with the link.

Check out the open source POCO C++ libraries at pocoproject.org/. There are downloads for Windows. For Linux, you may be able to get packages from the main repositories for your distro.