Skip to content

wsjcpp/wsjcpp-hashes

Repository files navigation

wsjcpp-hashes

Build Status Github Stars Github Stars Github Forks Total alerts Language grade: C/C++ deepcode

Intagrate to your project

$ wsjcpp install https://github.com/wsjcpp/wsjcpp-hashes:master

or include this files:

  • src.wsjcpp/wsjcpp_core/wsjcpp_core.h
  • src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp
  • src/md5.cpp
  • src/md5.h
  • src/smallsha1.cpp
  • src/smallsha1.h
  • src/wsjcpp_hashes.h
  • src/wsjcpp_hashes.cpp

Usage

#include <wsjcpp_hashes.h>

void main() {
    std::string sSource = "some123";
    std::string sSha1 = WsjcppHashes::sha1_calc_hex(sSource);
    std::string sMd5 = WsjcppHashes::md5_calc_hex(sSource);
    std::cout << "sha1('" << sSource << "') = " << sSha1 << std::endl;
    std::cout << "md5('" << sSource << "') = " << sMd5 << std::endl;
}

example output:

sha1('some123') = 1225f79dee075a65ca92df080106ab40d15e5ba1
md5('some123') = 302d62e9451df39a97f73dec7f9272ef