MD5/Implementation: Difference between revisions

m
→‎{{header|Phix}}: Executable library
m (→‎{{header|Phix}}: Executable library)
Line 4,142:
 
=={{header|Phix}}==
Non-optimised. Originally written by Davi Tassinari de Figueiredo. Included in the distribution as demo\rosetta\md5.exw
<lang Phix>function-- uxor(atom data1,atom data2)demo\rosetta\md5.exw
function uxor(atom data1,atom data2)
atom result = xor_bits(data1,data2)
if result<0 then result += #100000000 end if
Line 4,257 ⟶ 4,258:
 
 
global function md5(sequence message)
-- Given a string, returns a 16-byte hash of it.
 
Line 4,277 ⟶ 4,278:
end function
 
if include_file()=1 then
constant string fmt = "0x%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X\n"
 
printf(1,fmt,md5(""))
printf(1,fmt,md5("a"))
printf(1,fmt,md5("abc"))
printf(1,fmt,md5("message digest"))
printf(1,fmt,md5("abcdefghijklmnopqrstuvwxyz"))
printf(1,fmt,md5("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))
printf(1,fmt,md5("12345678901234567890123456789012345678901234567890123456789012345678901234567890"))</lang>
end if</lang>
{{out}}
<pre>
Line 4,296 ⟶ 4,299:
0x57edf4a22be3c955ac49da2e2107b67a
</pre>
 
 
=={{header|PicoLisp}}==
7,820

edits