I have some data coming through a web service that was described as base64 encoded.
Example: AgAOAAAAQQEA3AcKDhIyCNwHCg4SMgyYIzSWoACP1T2TRRw1MTExMDUwMTE2ICAAAAAAAAAAAAAA3AAjU1QsKzAyMjEuMGxiDQo=
However, attempting to decode this isn’t coming up with the results I would have expected:
>>> base64.b64decode('AgAOAAAAQQEA3AcKDhIyCNwHCg4SMgyYIzSWoACP1T2TRRw1MTExMDUwMTE2ICAAAAAAAAAAAAAA3AAjU1QsKzAyMjEuMGxiDQo=')
'\x02\x00\x0e\x00\x00\x00A\x01\x00\xdc\x07\n\x0e\x122\x08\xdc\x07\n\x0e\x122\x0c\x98#4\x96\xa0\x00\x8f\xd5=\x93E\x1c5111050116 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdc\x00#ST,+0221.0lb\r\n'
It looks like the end of the decoded string is kinda-sorta along the lines of what I’m looking for. It should theoretically be transformable to something resembling MT=2012-10-14 18:50:08, TT=2012-10-14 18:50:12, BT=00:A0:96:34:23:98, SN=5111050116 , BL=6.30V, S/H=4/3, Weight=221.0lb(100.24kg) but I can’t figure out what’s going on with the encoding here.
What I have so far, I probably need more info to decode everything but here it goes:
Datetime fields MT and TT in order are:
BT is, you just have to add the ‘:’ each two letters :
SN is:
Weight is:
Sorry but I don’t have any idea at the moment how the rest are stored, and since I don’t know what the range on those might be either I really have no way of decoding the rest, let me know if you can disclose a bit more information about what those fields should store.