But no matter what I try I can't get it to work with string input :
1 2 3 4 5 6
std::string canocJPFinal;
mynamespace::Sha256 sha_calculator;
sha_calculator.Update(canocJPFinal.c_str(),canocJPFinal.size());
sha_calculator.Final();
myprog.cpp:74: error: invalid conversion from 'const char*' to 'unsigned char*'
myprog.cpp:74: error: initializing argument 1 of 'void mynamespace::Sha256::Update(unsigned char*, size_t)'
I've tried all sorts of things to fix it .... casting, copying the string to a byte array, I just can't get it to work ! I'm sure I'm doing something stupid, but I think I've reached the point where I need a second pair of eyes on the problem.
I've even tried to copy the function argumentconcept from openssl's sha.h, but that doesn't help either :
.c_str() and .data() return const char*. You need a char*. You can use & on the first element in the string to get that. sha_calculator.Update(&canocJPFinal[0],canocJPFinal.size());