Fast Cross-Platform C/C++ Hashing Library
Solution 1
For usual crypto hashes (MD?, SHA? etc.), openssl is the most portable and probably fastest. None of the hashes you mentioned are good for high performance data structures like hash tables. The recommended hash functions for these data structures these days are: FNV, Jenkins and MurmurHash.
Solution 2
QT seem to implement MD4, MD5 and SHA1
Solution 3
I'd definitely go with CryptoPP, it has a nice license to go with it as well.
Solution 4
zlib has a built-in implementation of a crc32 variant, and is widely ported. =)
Solution 5
Take a look at the plibsys C library: it support MD5, SHA1, SHA-2 (224, 256, 384, 512), SHA-3 (224, 256, 384, 512) and GOST 34.11-94 cryptography hash algorithms. The library is portable and light-weight itself.
The Unknown
Updated on June 05, 2022Comments
-
The Unknown about 2 years
What's a high performance hashing library that's also cross platform for C/C++. For algorithms such as MD5, SHA1, CRC32 and Adler32.
I initially had the impression that Boost had these, but apparently not (yet).
The most promising one I have found so far is Crypto++, any other suggestions? http://www.cryptopp.com/ This seems to be quite comprehensive.
-
Andreas Magnusson about 15 yearsWhy include a whole Widget-library just to use its MD5 and SHA-1 implementations? If you're already using QT this could be a feasibel option otherwise it's overkill.
-
Skurmedel about 15 yearsYeah, just nick the code you need and you'll be set.
-
Jason S about 15 yearsinteresting. could you post links? (yes I know, I can google those...)
-
The Unknown about 15 yearsThanks, I will look in to openssl. The use of the hashes won't be for hash tables, but used as hashes for authentication and document verifications (was it tampered etc)
-
Johan over 14 yearsThat libtomcrypt locks interesting.
-
deft_code about 12 yearsDoxygen uses QTCore and none of the GUI classes. It turns out that QT is has a pretty good platform abstraction. See Doxygen FAQ #9.