String addPaddingToBase64(String base64Input) { while (base64Input.length % 4 != 0) { base64Input += '='; } return base64Input; }