gpt4 book ai didi

c++ - std::string 可以用于 openssl 加密 key 吗?

转载 作者:行者123 更新时间:2023-11-30 05:24:06 26 4
gpt4 key购买 nike

使用安全吗std::string使用 openssl 时的 key ?

我目前正在使用 std::vector<uint8_t>用于管理用于 openssl API 的 key ,因为我不确定如何使用 std::string处理不可打印的字符。

最佳答案

幸运的是,除了短字符串优化之类的东西,std::vector<char> 之间并没有太多区别。和 std::string .

std::string并不真正关心它包含什么,即使里面的字符不是有效的 ASCII/UTF8 字符/序列。

这是 std::basic_string 中的坏事之一,不幸的是,对于其余情况。

关于c++ - std::string 可以用于 openssl 加密 key 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38852618/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com