我有需要转换为的十六进制字符串const byte*
。我正在使用 Crypto++ 进行散列,它需要密钥位于const byte*
有什么方法可以将十六进制字符串转换为const byte*
使用任何 Crypto++ 库还是我必须自己提供?
有一个HexDecoderCrypto++ 中的类。
你需要喂养这个角色。看来Crypto++并没有直接区分字符和字节。因此 varren 提供的以下代码行将起作用:
string destination;
StringSource ss(source, true, new HexDecoder(new StringSink(destination)));
const byte* result = (const byte*) destination.data();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)