clean up the base64 md5 handling to use more Python functions
clean up the base64 md5 handling to use more Python functions