Generate SHA hash

hey guys im trying to generate a sha256 hash with std string, but i can't get this incomplete code puzzle to work, im a bit frustrated with this one
http://www.cryptopp.com/fom-serve/cache/50.html
1
2
3
4
5
6
7
8
void main()
{
	string pbData1 = "HELLO";

	BYTE* pbOutputBuffer;
	CryptoPP::SHA256().CalculateDigest(pbOutputBuffer, (byte*)pbData1.c_str(), pbData1.size());
	cout << pbOutputBuffer;
}


my problem is converting 'const char *' to 'const byte *' ..etc
I almost sure that byte is a typedef for char or unsigned char (ot int8_t for C++11). So you should have no problems with passing pointer to char here.
Last edited on
Topic archived. No new replies allowed.