Skip to content

@masak /a minima; example of the bug
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
$ cat bug
sub digest(Str $text) is export {
my $binary = Q:PIR {
.local string text
.local pmc digest
# Input
$P0 = find_lex '$text'
text = $P0
# Choose the right digest.
$P1 = loadlib 'digest_group'
digest = new 'SHA256'
# Calculate the digest.
digest.'Init'()
digest.'Update'(text)
$S0 = digest.'Final'()
%r = box $S0
};
# Convert to hex.
return [~] map { sprintf '%02x', .ord }, $binary.comb;
}
say digest('user_name=carl'.split("=")[1]);
say digest('carl');
$ perl6 bug
04f8996da763b7a969b1028ee3007569eaf3a635486ddab211d512c85b9df8fb
69bfe1e6e44821df7f8a0927bd7e61ef208fdb25deaa4353450bc3fb904abd52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.