Fast Cross-Platform C/C++ Hashing Library

11,084

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.

Share:
11,084
The Unknown
Author by

The Unknown

Updated on June 05, 2022

Comments

  • The Unknown
    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
    Andreas Magnusson about 15 years
    Why 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
    Skurmedel about 15 years
    Yeah, just nick the code you need and you'll be set.
  • Jason S
    Jason S about 15 years
    interesting. could you post links? (yes I know, I can google those...)
  • The Unknown
    The Unknown about 15 years
    Thanks, 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
    Johan over 14 years
    That libtomcrypt locks interesting.
  • deft_code
    deft_code about 12 years
    Doxygen uses QTCore and none of the GUI classes. It turns out that QT is has a pretty good platform abstraction. See Doxygen FAQ #9.