Create from hex strings #2

Open
opened 2021-04-13 23:54:30 -05:00 by wp · 0 comments
Owner

Use a str (hex) to create Bits and Bytes objects.

Optional "sep" argument allows a custom separator to be removed from the hex string.

If hex string is odd number of characters, imply first character is 0.

Can use bytes.fromhex() builtin function.

Example hex strings

"02:01:01:01:01:01"
"ff:ff:ff:ff:ff:ff"
"020101010101"
"ff-ff-ff-ff-ff-ff"
"de ad be ef"
"de, ad, be, ef" (list of bytes)
["de", "ad", "be", "ef"] (list of Bits(hexstr))
Use a str (hex) to create Bits and Bytes objects. Optional "sep" argument allows a custom separator to be removed from the hex string. If hex string is odd number of characters, imply first character is 0. Can use bytes.fromhex() builtin function. Example hex strings ``` "02:01:01:01:01:01" "ff:ff:ff:ff:ff:ff" "020101010101" "ff-ff-ff-ff-ff-ff" "de ad be ef" "de, ad, be, ef" (list of bytes) ["de", "ad", "be", "ef"] (list of Bits(hexstr)) ```
wp added the
enhancement
label 2021-04-13 23:54:30 -05:00
Sign in to join this conversation.
No description provided.