Jump to content

MD5/Implementation: Difference between revisions

m
→‎{{header|REXX}}: added whitespace.
m (→‎{{header|REXX}}: split a long line.)
m (→‎{{header|REXX}}: added whitespace.)
Line 4,527:
MD5: procedure; parse arg !; numeric digits 20 /*insure there's enough decimal digits.*/
a= '67452301'x; b= "efcdab89"x; c= '98badcfe'x; d= "10325476"x
#= length(!) /*length in bytes of the input message.*/
L=# #*8 //512; if L<448 then plus=448 - L /*is the length less than 448 ? */
if L>448 then plus=960 - L /* " " " greater " " */
if L=448 then plus=512 /* " " " equal to " */
Line 4,535:
/* [↑] ··· and a little of that.*/
do j=0 for length($) % 64 /*process the message (lots of steps).*/
a_= a; b_= b; c_= c; d_=d d /*save the original values for later.*/
chunk= j * 64 /*calculate the size of the chunks. */
do k=1 for 16 /*process the message in chunks. */
!.k= reverse( substr($, chunk + 1 + 4*(k-1), 4) ) /*magic stuff.*/
end /*k*/ /*────step────*/
a = .p1( a, b, c, d, 0, 7, 3614090360) /*■■■■ 1 ■■■■*/
Cookies help us deliver our services. By using our services, you agree to our use of cookies.