【发布时间】:2011-08-08 11:46:40
【问题描述】:
我需要使用 Crypto++,使用 SHA1 生成随机散列。目前我有:
#include <cryptopp/sha.h>
#include <cryptopp/filters.h>
#include <cryptopp/hex.h>
...
CryptoPP::SHA1 sha1;
string source = "Hello"; //This will be randomly generated somehow
string hash = "";
StringSource(source, true, new HashFilter(sha1, new HexEncoder(new StringSink(hash))));
我来编译的时候报如下错误:
error: expected type-specifier before 'HashFilter'
error: expected ')' before 'HashFilter'
error: 'StringSource' was not declared in this scope
谁能帮我解决这个问题?使用这个库是否有更简单的方法来执行此操作?我是使用 Crypto++ 的新手,因此我们将不胜感激。
谢谢。
【问题讨论】: