Created
January 5, 2011 04:56
-
-
Save poppen/765947 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Digest::MD5 qw( md5_hex ); | |
use feature qw( say ); | |
my $secret = $ARGV[0]; | |
my @argvs = split('&', $ARGV[1]); | |
my $params_ref; | |
for my $argv (@argvs) { | |
my($key, $val) = split('=', $argv); | |
$params_ref->{$key} = $val; | |
} | |
my $string = $secret; | |
for my $key (sort keys %{$params_ref}) { | |
$string .= $key; | |
$string .= $params_ref->{$key} | |
} | |
say md5_hex($string); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment