Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -23,7 +23,7 @@ constant k = ( $_ for ^16),
sub little-endian($w, $n, *@v) { (@v X+> ($w X* ^$n)) X% (2 ** $w) }
sub md5-pad(Buf $msg)
sub md5-pad(Blob $msg)
{
my \bits = 8 * $msg.elems;
my @padded = $msg.list, 0x80, 0x00 xx (-(bits div 8 + 1 + 8) % 64);
@ -41,12 +41,12 @@ sub md5-block(@H is rw, @X)
@H «=» ($A, $B, $C, $D);
}
sub md5(Buf $msg --> Buf)
sub md5(Blob $msg --> Blob)
{
my @M = md5-pad($msg);
my @H = 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476;
md5-block(@H, @M[$_ .. $_+15]) for 0, 16 ...^ +@M;
Buf.new: little-endian(8, 4, @H);
Blob.new: little-endian(8, 4, @H);
}
for 'd41d8cd98f00b204e9800998ecf8427e', '',