Closed stellarpower closed 4 months ago
Not exactly the same, but you can do like:
"42afe1".hexbytes # => Bytes[66, 175, 225]
Duplicate of #2886
Not exactly the same, but you can do like:
"42afe1".hexbytes # => Bytes[66, 175, 225]
Thanks, I could definitely use that for now. The spaces I think would be very useful, having previously worked with HID Report desciptors where you wanna see the boundary between bytes - but I could split the string on whitespace, rejoin and then call hexbytes.
Feature Request
Don't know if there's a neat and terse way to do this already (probably some way), but, when working with binary data or similar, it's be nice to have a percent syntax for creating array literals of UInts without having to type as much:
Ideally the length would be inferred from the number of characters, and enforced to be the same for all elements as well as enforced to fir exactly in one of the built-in unsigned integer types.I think anything other than unsigned integers would be fair to be out of scope and cause more confusion.
Thanks