3

What is the fastest (most performant) method to generate MD5 checksums on macOS?

I'm currently using the stock /sbin/md5 and it takes an order of magnitude longer than generic Linux on a similar spec'd host.

1
  • Are you generating one md5 digest at a time? Is the input file or memory based? Are you launching a new instance of md5 for every digest? Adding this information to your question will help attract better answers. Jun 25, 2023 at 16:11

1 Answer 1

3

I'm currently using the stock /sbin/md5 and it takes an order of magnitude longer than generic linux on a similar spec'd host.

This is likely because the MD5 command line utility is included as part of the OpenSSL distribution. Of which, the latest version of macOS is using v0.9.8. You can find this on opensource.apple.com under the macOS 13.2 Release (scroll down to find OpenSSL098-84.120.1 and you can click on the GitHub link to take you directly to the source).

By comparison, FreeBSD 13.2-RELEASE (my other OS of choice) is utilizing OpenSSL version 1.1.1t. I would bet the Linux distro you're using likewise, utilizes a more recent version of OpenSSL. 3.0 and 3.1 were only released in November 2022 and March 2023 respectively (no v2, BTW), so it's not likely to be widely distributed yet.

You can upgrade OpenSSL by installing it via MacPorts or Homebrew (or go to version 3) Be aware that there are caveats because it doesn't replace your existing OpenSSL, but installs alongside it.

Further reading and resources...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .