SHA-256: Difference between revisions

→‎{{header|Perl 6}}: using the new polymod function
(Updated second D entry)
(→‎{{header|Perl 6}}: using the new polymod function)
Line 1,054:
push @b, 0x80; push @b, 0 until (8*@b-448) %% 512;
push @b, reverse gather for ^8 { take $l%.polymod(256; $lxx div=256 }7);
my @word = :256[@b.shift xx 4] xx @b/4;
Line 1,078:
@H = @H Z[m+] @h;
}
return Blob.new: map ->{ $wordreverse is.polymod(256 rwxx {3) }, @H;
reverse gather for ^4 { take $word % 256; $word div= 256 }
}, @H;
}</lang>
{{out}}
1,935

edits