use of Digest::SHA instead of Digest::SHA1 #100

Closed
carnil opened this Issue Jan 14, 2012 · 3 comments

2 participants

@carnil

Hi

Digest::SHA is part of the standard perl distribution since perl v5.9.3 so this reduces the number of external dependencies by one. Would it thus be possible to use Digest::SHA instead of Digest::SHA1 in lib/MojoMojo/Schema/Result/Person.pm ?

Thanks in advance

Regards,
Salvatore

@carnil

Hi

The following patch was applied to the Debian package by Gregor Herman:

Description: use Digest::SHA (in core) instead of Digest::SHA1 (removed from Debian)
Origin: vendor
Bug-Debian: http://bugs.debian.org/655825
Author: gregor herrmann <gregoa@debian.org>
Last-Update: 2012-01-14
Forwarded: no

--- a/lib/MojoMojo/Schema/Result/Person.pm
+++ b/lib/MojoMojo/Schema/Result/Person.pm
@@ -3,7 +3,7 @@
 use strict;
 use warnings;

-use Digest::SHA1;
+use Digest::SHA;

 use parent qw/MojoMojo::Schema::Base::Result/;

@@ -228,7 +228,7 @@

 sub hashed {
     my ( $self, $secret ) = @_;
-    return Digest::SHA1::sha1_hex( $self->id . $secret );
+    return Digest::SHA::sha1_hex( $self->id . $secret );
 }

 # FIXME: the formatter is arbitrarily taken to be Textile; it could be MultiMarkdown

See http://bugs.debian.org/655825

Regards
Salvatore

@marcusramberg
MojoMojo member
@carnil
@envi envi added a commit to envi/mojomojo that referenced this issue Feb 14, 2012
@marcusramberg marcusramberg Use SHA. Closes #100 c92067a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment