Skip to content

Instantly share code, notes, and snippets.

Created October 12, 2017 20:34
#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