Digest::SHA 相对于 Digest::SHA1 有哪些优点?
使用 Digest::SHA 有什么优势超过 Digest::SHA1 或反之亦然?两者似乎都得到了维护,但我不认为 Digest::SHA1 与 Digest::SHA1 一起存在的原因。
Are there any advantages in using Digest::SHA over Digest::SHA1 or vice versa? both seem to be maintained but I don't see a reason for Digest::SHA1 to even exist with the existence of Digest::SHA
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有,
Digest::SHA1
是遗留的,SHA1
也是如此。根据Digest::SHA1
的文档:它清楚地引用了
Digest::SHA
。Digest::SHA
中的实现比Digest::SHA1
快一点(根据Digest.pm
的文档 - 你应该做什么无论如何可能正在使用)。Digest
是Digest
命名空间中所有模块的工厂,它优先考虑Digest::SHA
而不是Digest::SHA1
。您甚至可以认为Digest::SHA1
已被弃用了两倍,因为它已被Digest::SHA2
取代。我相信在这里证实“已弃用”一词可能有用。我的意思只是说
Digest::SHA1
对于 SHA 系列中的非 SHA1 哈希值没有用处——其他发行版可以处理更多.. Digest::SHA1 也更慢..据我所知,它仍然受到支持,并且不久前就有了稳定版本:Digest-SHA1-2.13 - 03 Jul 2010 - Gisle AasThere is none,
Digest::SHA1
is legacy, as isSHA1
. Per the docs ofDigest::SHA1
:It clearly references
Digest::SHA
. The implementation inDigest::SHA
is a bit faster thanDigest::SHA1
(per the docs ofDigest.pm
-- what you should probably be using anyway).Digest
is a factory for all modules in theDigest
namespace, it prioritizesDigest::SHA
overDigest::SHA1
. You could even argueDigest::SHA1
is twice over deprecated, as it was replaced byDigest::SHA2
.I believe it probably useful to substantiate the term "deprecated" here. I simply mean that
Digest::SHA1
isn't useful for non-SHA1 hashes that are still in the SHA family -- other distros can handle more.. Digest::SHA1 is also slower.. To the best of my knowledge it is still supported and has a stable release not all that long ago: Digest-SHA1-2.13 - 03 Jul 2010 - Gisle Aas编写为使用
Digest::SHA1::sha1
的内容,或者(愚蠢地)使用"Digest::$type"->new
代替的内容Digest->new($type)
可能需要Digest::SHA1
。除此之外,首选Digest::SHA
,并且默认情况下将其用于Digest->new("SHA-1")
。Stuff that was written to use
Digest::SHA1::sha1
, or which (in a fit of silliness) does"Digest::$type"->new
instead ofDigest->new($type)
might needDigest::SHA1
. Other than that,Digest::SHA
is preferred, and it will be used by default forDigest->new("SHA-1")
.