What's an idiomatic way of treating a bytestring nibblewise and pretty printing its hexadecimal (0-F) representation?
putStrLn . show . B.unpack
-- [1,126]
Which, upon further work
putStrLn . show . map (\x -> N.showIntAtBase 16 (DC.intToDigit) x "") . B.unpack
["1","7e"]
But what I really want is
["1","7","e"]
Or better yet
['1','7','e']
I could munge up ["1","7e"] but that string manipulation whereas I'd rather do numeric manipulation. Do I need to drop down to shifting and masking numeric values?
showHex
will not pad to 2. – Prussian