first base64 implementation