Category : recursion

I am trying to optimise the merkle root calculation as much as possible. So far, I implemented it in Python which resulted in this question and the suggestion to rewrite it in C++. #include <iostream> #include <vector> #include <string> #include <fstream> #include <streambuf> #include <sstream> #include <openssl/evp.h> #include <openssl/sha.h> #include <openssl/crypto.h> std::vector<unsigned char> double_sha256(std::vector<unsigned char> ..

Read more

def recursiveDict(): return collections.defaultdict(recursiveDict) # I can create a dictionary like the following dic = recursiveDict() dic[‘a’] = 1 dic[‘a’][‘a’] = 1 dic[‘a’][‘a’][‘a’] = 1 dic[‘a’][‘a’][‘a’][‘a’] = 1 and so on…. I have returned to work with C++ after working for 4 years with Python and other dynamic languages. I wanted to be able to ..

Read more