improve base64 pad implementation