Add routines for calculating SHA1 and MD5 digests, based on the