borkdude / jet

CLI to transform between JSON, EDN, YAML and Transit using Clojure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Base64 support

terinjokes opened this issue · comments

jq has support for encoding and decoding base64 strings (@base64 and @base64d respectfully). I often want to work with collections that have base64 strings, but found there's currently no support.

I've found that this does work (though very verbose) in Babashka, but not in jet.

(String. (.. java.util.Base64 getDecoder (decode "TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu")))
;"Many hands make light work."

Is your proposal to make the babashka example work in jet, or to offer functions to decode and encode base64?

I would definitely prefer something shorter, if possible.

We could add base64/decode and base64/encode (which go from string to string)?

That seems like a reasonable compromise for me.

Available as jet 0.4.23