foo ~ $ ./a.out doskias e peeras ZG9za2lhcyBlIHBlZXJhcw== foo ~ $ ./a.out ZG9za2lhcyBlIHBlZXJhcw== doskias e peeras foo ~ $ cat base64.d import std.stdio; import std.string; import std.base64; int main(char[][] args) { if (args[1 .. $].length == 0) return 0; char[] s = join(args[1 .. $], " "); try writefln(decode(s)); catch (Exception e) writefln(encode(s)); return 0; }