summaryrefslogtreecommitdiff
path: root/decoders/common
diff options
context:
space:
mode:
Diffstat (limited to 'decoders/common')
-rw-r--r--decoders/common/srdhelper/mod.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/decoders/common/srdhelper/mod.py b/decoders/common/srdhelper/mod.py
index b559c95..3c495b4 100644
--- a/decoders/common/srdhelper/mod.py
+++ b/decoders/common/srdhelper/mod.py
@@ -21,6 +21,9 @@
def bcd2int(b):
return (b & 0x0f) + ((b >> 4) * 10)
+def bin2int(s: str):
+ return int('0b' + s, 2)
+
def bitpack(bits):
res = 0
for i, b in enumerate(bits):