www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21843] New: std.format could support %{x,X} for ubyte[]


          Issue ID: 21843
           Summary: std.format could support %{x,X} for ubyte[]
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: pro.mathias.lang gmail.com

import std;

void main ()
    ubyte[] data = [42, 69, 250];
    writefln("%X", data);

This currently throws an Exception. I think it could print `2A45FA`. This would
be very handy to save on space when printing large ubyte arrays. This is an
enhancement request, as there is nothing wrong with the current behavior.

Apr 18 2021