Solution:
The trick here is to input an ascii representation of your string (hence, the double(string) call). MessageDigest outputs 16 bytes which represents 32 chars. So we use BigInteger to convert the bytes to that radix.
import java.security.*;
import java.math.*;
md = MessageDigest.getInstance('MD5');
hash = md.digest(double('Your string.'));
bi = BigInteger(1, hash);
char(bi.toString(16))
ans =
b99e5935368933bafefed10b99bb0489