Created
October 12, 2017 20:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/unordered_map.hpp> | |
#include <map_printer.hpp> | |
#include <openssl/sha.h> | |
#include <string> | |
#include <sstream> | |
#include <iostream> | |
void print_map(const boost::unordered_map<int, int>& mapIn) { | |
std::cout << "{" << std::endl; | |
for (auto it = mapIn.cbegin(); it != mapIn.cend(); ++it) { | |
std::cout << it->first << ": " << it->second << std::endl; | |
} | |
std::cout << "}" << std::endl; | |
} | |
std::string get_sha1(unsigned char * in, size_t in_len) { | |
unsigned char outbuf[20]; | |
SHA1(in, in_len, outbuf); | |
std::stringstream ss; | |
ss << outbuf; | |
return ss.str(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment