You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to print out an ethernet MAC address. There appears to be no direct way to do this with IOStream as anything with a hex format is prefixed with "0x". There being 6 bytes to a MAC address I get something like 0xde:0xad:0xbe:0xef:0xfe:0xed when I would rather see de:ad:be:ef:fe:ed.
I could make the enhancement and submit a PR but I would like to get agreement on the approach first. I also just noticed that printf is similar but not the same as standard C printf in its format.
One option would be to add an optional argument to bin(), oct(), hex() to indicate exclusion of the prefix (setting a protected variable). Some additional special character to the format string would need to be added to also manipulate this. Or perhaps just the format could be enhanced without affecting bin()/oct()/hex().
Any recommendations?
The text was updated successfully, but these errors were encountered:
I would like to print out an ethernet MAC address. There appears to be no direct way to do this with IOStream as anything with a hex format is prefixed with "0x". There being 6 bytes to a MAC address I get something like 0xde:0xad:0xbe:0xef:0xfe:0xed when I would rather see de:ad:be:ef:fe:ed.
I could make the enhancement and submit a PR but I would like to get agreement on the approach first. I also just noticed that printf is similar but not the same as standard C printf in its format.
One option would be to add an optional argument to bin(), oct(), hex() to indicate exclusion of the prefix (setting a protected variable). Some additional special character to the format string would need to be added to also manipulate this. Or perhaps just the format could be enhanced without affecting bin()/oct()/hex().
Any recommendations?
The text was updated successfully, but these errors were encountered: