shithub: mc

ref: a3087100fa88b5d6a420d20d6fa5808d63696170
dir: /libcryptohash/test/md5-test.myr/

View raw version
use std
use cryptohash

const main = {
	/* zero hash */
	/*
	print(cryptohash.md5(""))
	*/
	/* arbitrary text */
	print(cryptohash.md5("hello"))
	/*
	/* 64 byte block */
	print(cryptohash.md5("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))
	/* tail spanning */
	print(cryptohash.md5("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb"))
	*/
}

const print = {b
	for x in b
		if (x <= 0xf)
			std.put("0%xb", x)
		else
			std.put("%xb", x)
		;;
	;;
        std.put("\n")
}