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.
Are there any advantages in using Digest::SHA over Digest::SHA1 or vice versa? both seem
Share
There is none,
Digest::SHA1is legacy, as isSHA1. Per the docs ofDigest::SHA1:It clearly references
Digest::SHA. The implementation inDigest::SHAis a bit faster thanDigest::SHA1(per the docs ofDigest.pm— what you should probably be using anyway).Digestis a factory for all modules in theDigestnamespace, it prioritizesDigest::SHAoverDigest::SHA1. You could even argueDigest::SHA1is 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::SHA1isn’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