move the base64 and sha1 funcs into a better place