Permalink
Browse files

Corrected links to the Wikipedia resources and hashes descriptions.

  • Loading branch information...
digit4lfa1l committed Dec 10, 2012
1 parent e4b474c commit c70441dda3ba5faf83238607877bb07ca53af2de
Showing with 25 additions and 25 deletions.
  1. +15 −15 lib/DDG/Goodie/CryptHashCheck.pm
  2. +10 −10 t/CryptHashCheck.t
@@ -5,9 +5,9 @@ use DDG::Goodie;
# A comprehensive reference for hashing functions from Wikipedia.
-use constant MD5HERF => "http://en.wikipedia.org/wiki/MD5#MD5_hashes";
-use constant SHA1HREF => "http://en.wikipedia.org/wiki/SHA-1#Example_hashes";
-use constant SHA2HREF => "http://en.wikipedia.org/wiki/SHA-2#Examples_of_SHA-2_variants";
+use constant MD5HERF => "http://en.wikipedia.org/wiki/MD5";
+use constant SHA1HREF => "http://en.wikipedia.org/wiki/SHA-1";
+use constant SHA2HREF => "http://en.wikipedia.org/wiki/SHA-2";
zci is_cached => 1;
@@ -29,48 +29,48 @@ attribution github => ['https://github.com/digit4lfa1l', 'digit4lfa1l'];
handle remainder => sub {
my ($md5) = /^[0-9a-f]{32}$/i;
if ($md5){
- my $text = sprintf qq(This is a MD5 cryptographic hash.);
- my $html = sprintf qq(This is a <a href="%s">MD5</a> cryptographic hash.),MD5HERF;
+ my $text = sprintf qq(This is a 128 bit MD5 cryptographic hash.);
+ my $html = sprintf qq(This is a 128 bit <a href="%s">MD5</a> cryptographic hash.),MD5HERF;
return $text, html => $html;
}
my ($sha1) = /^[0-9a-f]{40}$/i;
if ($sha1){
- my $text = sprintf qq(This is a SHA-1/40 cryptographic hash.);
- my $html = sprintf qq(This is a <a href="%s">SHA-1/40</a> cryptographic hash.),SHA1HREF;
+ my $text = sprintf qq(This is a 160 bit SHA-1 cryptographic hash.);
+ my $html = sprintf qq(This is a 160 bit <a href="%s">SHA-1</a> cryptographic hash.),SHA1HREF;
return $text, html => $html;
}
my ($sha224) = /^[0-9a-f]{56}$/i;
if ($sha224){
- my $text = sprintf qq(This is a SHA-2/224 cryptographic hash.);
- my $html = sprintf qq(This is a <a href="%s">SHA-2/224</a> cryptographic hash.),SHA2HREF;
+ my $text = sprintf qq(This is a 224 bit SHA-2 cryptographic hash.);
+ my $html = sprintf qq(This is a 224 bit <a href="%s">SHA-2</a> cryptographic hash.),SHA2HREF;
return $text, html => $html;
}
my ($sha256) = /^[0-9a-f]{64}$/i;
if ($sha256){
- my $text = sprintf qq(This is a SHA-2/256 cryptographic hash.);
- my $html = sprintf qq(This is a <a href="%s">SHA-2/256</a> cryptographic hash.),SHA2HREF;
+ my $text = sprintf qq(This is a 256 bit SHA-2 cryptographic hash.);
+ my $html = sprintf qq(This is a 256 bit <a href="%s">SHA-2</a> cryptographic hash.),SHA2HREF;
return $text, html => $html;
}
my ($sha384) = /^[0-9a-f]{96}$/i;
if ($sha384){
- my $text = sprintf qq(This is a SHA-2/384 cryptographic hash.);
- my $html = sprintf qq(This is a <a href="%s">SHA-2/384</a> cryptographic hash.),SHA2HREF;
+ my $text = sprintf qq(This is a 384 bit SHA-2 cryptographic hash.);
+ my $html = sprintf qq(This is a 384 bit <a href="%s">SHA-2</a> cryptographic hash.),SHA2HREF;
return $text, html => $html;
}
my ($sha512) = /^[0-9a-f]{128}$/i;
if ($sha512){
- my $text = sprintf qq(This is a SHA-2/512 cryptographic hash.);
- my $html = sprintf qq(This is a <a href="%s">SHA-2/512</a> cryptographic hash.),SHA2HREF;
+ my $text = sprintf qq(This is a 512 bit SHA-2 cryptographic hash.);
+ my $html = sprintf qq(This is a 512 bit <a href="%s">SHA-2</a> cryptographic hash.),SHA2HREF;
return $text, html => $html;
}
View
@@ -13,28 +13,28 @@ ddg_goodie_test(
DDG::Goodie::CryptHashCheck
)],
'hash 5c0847eccfaeabf4a0207d42a2986992' => test_zci(
- qq(This is a MD5 cryptographic hash.),
- html => qq(This is a <a href="http://en.wikipedia.org/wiki/MD5#MD5_hashes">MD5</a> cryptographic hash.),
+ qq(This is a 128 bit MD5 cryptographic hash.),
+ html => qq(This is a 128 bit <a href="http://en.wikipedia.org/wiki/MD5">MD5</a> cryptographic hash.),
answer_type => "crypthashcheck"
),
'hash ecaceaca62d6c47190ed6c6f94a298f28a46450fda0bd1ec8fc64bc4a7a8cd436791a35f3c4e339b7ae480c1b751f1c1' => test_zci(
- qq(This is a SHA-2/384 cryptographic hash.),
- html => qq(This is a <a href="http://en.wikipedia.org/wiki/SHA-2#Examples_of_SHA-2_variants">SHA-2/384</a> cryptographic hash.),
+ qq(This is a 384 bit SHA-2 cryptographic hash.),
+ html => qq(This is a 384 bit <a href="http://en.wikipedia.org/wiki/SHA-2">SHA-2</a> cryptographic hash.),
answer_type => "crypthashcheck"
),
'hash b1d7eb51d4372c505446abca04835a101275e498' => test_zci(
- qq(This is a SHA-1/40 cryptographic hash.),
- html => qq(This is a <a href="http://en.wikipedia.org/wiki/SHA-1#Example_hashes">SHA-1/40</a> cryptographic hash.),
+ qq(This is a 160 bit SHA-1 cryptographic hash.),
+ html => qq(This is a 160 bit <a href="http://en.wikipedia.org/wiki/SHA-1">SHA-1</a> cryptographic hash.),
answer_type => "crypthashcheck"
),
'hash 6286e0a5cbc030f7b2d105f594ae0afb9105c92175c6b07ff454734c23cd0bddfed77639fe59b68a70b8c78af27657f611cbe89c27f7a47b978fa9449808c19f' => test_zci(
- qq(This is a SHA-2/512 cryptographic hash.),
- html => qq(This is a <a href="http://en.wikipedia.org/wiki/SHA-2#Examples_of_SHA-2_variants">SHA-2/512</a> cryptographic hash.),
+ qq(This is a 512 bit SHA-2 cryptographic hash.),
+ html => qq(This is a 512 bit <a href="http://en.wikipedia.org/wiki/SHA-2">SHA-2</a> cryptographic hash.),
answer_type => "crypthashcheck"
),
'hash a8a35ab9036388fd42fe1d73d93ede7ec604044ba4753259fafbf718' => test_zci(
- qq(This is a SHA-2/224 cryptographic hash.),
- html => qq(This is a <a href="http://en.wikipedia.org/wiki/SHA-2#Examples_of_SHA-2_variants">SHA-2/224</a> cryptographic hash.),
+ qq(This is a 224 bit SHA-2 cryptographic hash.),
+ html => qq(This is a 224 bit <a href="http://en.wikipedia.org/wiki/SHA-2">SHA-2</a> cryptographic hash.),
answer_type => "crypthashcheck"
),

0 comments on commit c70441d

Please sign in to comment.