dataurl
Installation
go install go.shabbyrobe.org/dataurl@latest
Usage
$ echo "foo" | dataurl
data:;base64,Zm9vCg==
$ echo "foo" | dataurl | dataurl -d -f
foo
$ cat /path/to/image.jpg | dataurl
data:image/jpeg;base64,...
Expectation management
This is a tool I hack on for my own amusement in an ad-hoc fashion. No
stability guarantees are made, the code is not guaranteed to work, and
anything may be changed, renamed or removed at any time as I see fit.
Having said that, there are some useful things in here, and you may get some
use out of them.
If you wish to use any of this, I strongly recommend you copy-paste pieces
as-needed (including tests and license/attribution) into your own project,
or fork it for your own purposes.
Bug reports are welcome, but contributions and feature requests will probably
not be acknowledged.