base64 conversion functions and tests