Skip to content

Commit

Permalink
fixed xor_encode formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 5, 2012
1 parent 2d31456 commit 23b5829
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Mojo/Util.pm
Expand Up @@ -324,11 +324,11 @@ sub xml_escape {

sub xor_encode {
my ($input, $key) = @_;
my $len = length $key;
my $tmp = '';
my $output = '';
$output .= $tmp ^ $key while length($tmp = substr($input, 0, $len, '')) == $len;
return $output .= $tmp ^ substr($key, 0, length $tmp, '');
my $len = length $key;
my $buffer = my $output = '';
$output .= $buffer ^ $key
while length($buffer = substr($input, 0, $len, '')) == $len;
return $output .= $buffer ^ substr($key, 0, length $buffer, '');
}

sub _adapt {
Expand Down

0 comments on commit 23b5829

Please sign in to comment.