gpt4 book ai didi

shell - OpenSSL 从 shell 标准输入创建 SHA 哈希

转载 作者:行者123 更新时间:2023-12-03 13:58:33 24 4
gpt4 key购买 nike

如何在不使用文件的情况下从命令行使用 OpenSSL 生成 SHA-512 哈希?

我试过这个

echo "password" | openssl dgst -sha512

但哈希看起来不对(与 http://hash.online-convert.com/sha512-generator 相比)。

最佳答案

试试 echo -n "password" .

发生的事情是 echo 的换行符添加到字符串的末尾正在被散列。 -necho抑制这种行为。

关于shell - OpenSSL 从 shell 标准输入创建 SHA 哈希,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11066171/

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