Move Digest to its own file.
Fix base64 encoding.