fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/python/pyosmocom/+/39454?usp=email )
Change subject: utils: h2i(): use list() to convert bytes to integers
......................................................................
utils: h2i(): use list() to convert bytes to integers
Change-Id: Icb0d0803b7ae4e0b3a292ba96f58c26d0ca88abd
---
M src/osmocom/utils.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom refs/changes/54/39454/1
diff --git a/src/osmocom/utils.py b/src/osmocom/utils.py
index 6c823ec..347bb93 100644
--- a/src/osmocom/utils.py
+++ b/src/osmocom/utils.py
@@ -78,7 +78,7 @@
def h2i(s: Hexstr) -> List[int]:
"""convert from a string of hex nibbles to a list of
integers"""
- return [(int(x, 16) << 4)+int(y, 16) for x, y in zip(s[0::2], s[1::2])]
+ return list(h2b(s))
def i2h(s: List[int]) -> hexstr:
--
To view, visit
https://gerrit.osmocom.org/c/python/pyosmocom/+/39454?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Icb0d0803b7ae4e0b3a292ba96f58c26d0ca88abd
Gerrit-Change-Number: 39454
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>