A very fast, simple, and optimized md5 alghorithm in c++ with static libs.
Original code
Do you like this project? Support it by donating
Paypal: Donate or paypal.me/michelerenzullo
Bitcoin: 1K9RF3s4aocmaRbh2Zu2FuHjrcg5BNeDxU
- input: char[], const char *, uint8_t[], uint8_t *, or string, see examples inside intmain.cpp
- adapt automatically to input with template and c++17 constexpr
- output: string md5
See intmain.cpp for further examples
std::string test = "hello";
std::string test_md5 = md5(test,test.length());
- You can include the header, insert into your project lightmd5.cpp and compile together(see intmain.cpp)
$ g++ -std=c++17 intmain.cpp lightmd5.cpp -o lightmd5.exe -Os -s
- Or you can include the header and use static libs: you have to copy "a" files inside lib folder of your compiler and add option "-llightmd5" (or "-llightmd5_32")
$ g++ -std=c++17 intmain.cpp -llightmd5(or -llightmd5_32 -m32) -o lightmd5.exe -Os -s
If you can't compile with -std=c++17, don't include header and inside you cpp source define only the main function:
std::string md5_process(uint8_t* , size_t);
See intmain.cpp examples to call md5_process(...)