i have a very simple solution for this specific problem, you can check that out: https://gist.github.com/imneonizer/b64