Make the digest function configurable and default to MD5