我想打印以下哈希数据。我应该怎么做?
unsigned char hashedChars[32];
SHA256((const unsigned char*)data.c_str(),
data.length(),
hashedChars);
printf("hashedChars: %X\n", hashedChars); // doesn't seem to work??
printf
在 C++ 中也是有效的!有时我会使用它来代替流,因为它有其适用的场合。 - aardvarkkprintf
对我来说实际上是有效的,但是cout
对我来说不起作用。 我正在使用xCode
,并且“hashedChars:”被打印出来了,但其余部分没有。 - louis.luohashedChars[i]
强制转换为unsigned int
,即hex << (unsigned int)hashedChars[i]
才能使它对我有效。 - Tomislav Nakic-Alfirevic