This isn't going to pass muster, sorry.    On a practical level, we share this file with ESP32.  On an architectural level, having String and base64 mucking about each others' innards feels like a bad thing to do.  I understand where you're coming from, but there's got to be a better way.