Skip to content

Commit

Permalink
senml: Fix data record encoding to use binascii instead of base64.
Browse files Browse the repository at this point in the history
  • Loading branch information
iabdalkader authored and dpgeorge committed Mar 6, 2023
1 parent 295a9e3 commit c860319
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion micropython/senml/senml/senml_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ def _build_rec_dict(self, naming_map, appendTo):
if (
naming_map["vd"] == "vd"
): # neeed to make a distinction between json (needs base64) and cbor (needs binary)
result[naming_map["vd"]] = base64.b64encode(self._value)
result[naming_map["vd"]] = binascii.b2a_base64(self._value, newline=False).decode(
"utf8"
)
else:
result[naming_map["vd"]] = self._value
else:
Expand Down

0 comments on commit c860319

Please sign in to comment.