From 39210738e383e5fb197faa8ccb239eb6febeff09 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Mon, 6 Jan 2020 08:58:32 -0800 Subject: [PATCH] Update umid_parser.py Can't figure out how these are formatted as string yet so will just output raw hex --- wavinfo/umid_parser.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wavinfo/umid_parser.py b/wavinfo/umid_parser.py index d0c6a9c..c5055f5 100644 --- a/wavinfo/umid_parser.py +++ b/wavinfo/umid_parser.py @@ -3,7 +3,12 @@ import binascii def binary_to_string(binary_value): - return str(binascii.hexlify(binary_value), encoding='ascii') + retval = '' + for n in range(0, len(binary_value)): + sr = "{:02x}".format(binary_value[n]) + retval += sr + + return retval class UMIDParser: @@ -24,7 +29,7 @@ class UMIDParser: # return self.raw_umid[0:32] def basic_umid_to_str(self): - return binary_to_string(self.raw_umid[0:13]) + '-' + binary_to_string(self.raw_umid[13:3]) + return binary_to_string(self.raw_umid[0:32]) # # @property # def universal_label_is_valid(self) -> bool: