From a8b662fcb11fc2a42a174b680aa4333fd7f5a66c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Ates?= Date: Fri, 8 Jan 2016 12:22:09 +0100 Subject: [PATCH] Add hex to int helper function. --- utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils.py b/utils.py index 3fd0ca1..b420dfd 100644 --- a/utils.py +++ b/utils.py @@ -48,3 +48,6 @@ def get_crc_16_CCITT(string): def switch_big_to_little_indian(string): return string[::-1] + +def hex_to_int(hex_value): + return int(hex_value.encode('hex'), 16)