Linux/Mac hashing SHA-1
There's not a huge amount to review here.



It looks like the Apple code is intended to be a drop-in replacement for OpenSSL, so you could probably just rename to match, rather than creating a new name:

#ifdef  __APPLE__
#define COMMON_DIGEST_FOR_OPENSSL
#include &lt;CommonCrypto/CommonDigest.h&gt;
#define SHA1 CC_SHA1
#else
#include &lt;openssl/sha.h&gt;
#endif


Whichever approach you take, don't forget to #undef the macro when you've finished using it (definitely before the end of the header), to avoid polluting the macro namespace for others.



I would prefer src.data() to &amp;src[0] as the idiomatic way to access a string's characters as an array of char.

And I think I prefer sizeof src to SHA_DIGEST_LENGTH in the first overload, so that the connection is clear.

Is there any reason that src can't be a reference to const in both versions?

inline void thorSHA1(ThorSHADigestStore&amp; dest, ThorSHADigestStore const&amp; src)
{
    THOR_SHA1(src, sizeof src, dest);
}

inline void thorSHA1(ThorSHADigestStore&amp; dest, std::string const&amp; src)
{
    auto const src_bytes = reinterpret_cast&lt;const unsigned char*&gt;(src.data());
    THOR_SHA1(src_bytes, src.length(), dest);
}




I withhold comment on the suitability of SHA-1 for this purpose, as that appears to be something you're stuck with.