Calculate a digest (md5, sha, ...) from a blob or a string