On Saturday, 2 September 2017 at 15:53:25 UTC, bitwise wrote:
> [...]
This seems to work well enough.
string toAsciiHex(string str)
{
     import std.array : appender;
     auto ret = appender!string(null);
     ret.reserve(str.length * 2);
     foreach(c; str) ret.put(format!"%x"(c));
     return ret.data;
}