String removePaddingFromBase64(String base64Input) { while (base64Input.endsWith('=')) { base64Input = base64Input.substring(0, base64Input.length - 1); } return base64Input; }