Suggested function: bytearray.to_hex / bytearray.from_hex
Quantumplation opened this issue · 3 comments
Quantumplation commented
When debugging, it'd be super helpful to be able to hex-encode a bytearray so I can pass it to trace
; You might just say use cbor.diagnostic, but I prefer the hex view over cbor.diagnostic.
There may be other use cases, though not many come to mind.
Quantumplation commented
(feel free to close if you feel this is out of scope, just dropping the suggestion here while it's on my mind)
KtorZ commented
Honestly. from_hex
is going to be a pain in the a** on chain, especially without bitwise primitives. Though writing an encoder may be more reasonable. Actually, so "reasonable" that we already did it 😬!
Lines 212 to 237 in a467c81
So I guess it's mainly about moving that function to the bytearray
module