use Digest::HMAC_SHA1; my @order = sort { lc($a) cmp lc($b) } keys %$request; my $data = reduce { $a . $b . $request->{$b} } '', @order; my $digest = Digest::HMAC_SHA1->new( $self->secret_access_key ); $digest->add( $data );