RosettaCodeData/Task/MD5/LiveCode/md5-2.livecode

25 lines
1.1 KiB
Plaintext

command md5testsuite
// rfc1321 MD5 test suite:
local md5
put md5sum("") is "d41d8cd98f00b204e9800998ecf8427e" into md5["empty"]
put md5sum("a") is "0cc175b9c0f1b6a831c399e269772661" into md5["a"]
put md5sum("abc") is "900150983cd24fb0d6963f7d28e17f72" into md5["abc"]
put md5sum("message digest") is "f96b697d7cb7938d525a2f31aaf161d0" into md5["message digest"]
put md5sum("abcdefghijklmnopqrstuvwxyz") is "c3fcd3d76192e4007dfb496cca67e13b" \
into md5["abclower"]
put md5sum("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") \
is "d174ab98d277d9f5a5611c2c9f419d9f" into md5["abcupper"]
put md5sum("12345678901234567890123456789012345678901234567890123456789012345678901234567890")\
is "57edf4a22be3c955ac49da2e2107b67a" into md5["123"]
repeat for each line n in the keys of md5
if md5[n] is not true then
put "err" & tab & n & return after results
exit repeat
else
put "ok" & tab & n & return after results
end if
end repeat
put results
end md5testsuite