-
Notifications
You must be signed in to change notification settings - Fork 123
Open
Description
Description
It would be great if we decode hex strings to bytes (and similarly encode to them). For example:
def main():
t = MyClass(data=b"abc")
# Somehow configure the Struct field that it's a hex encoded byte string.
# Right, the input expects a base64 encoded byte string.
tt = decode(b'{"data":"0x616263"}', type=MyClass)
assert t == tt
if __name__ == "__main__":
main()I know this is doable using a dec_hook/enc_hook, but at my job we are decoding a huge number of such fields and it's taking a non-trivial time of our data decoding -- moving this logic directly in the msgpsec library should provide a significant boost in performance.
Metadata
Metadata
Assignees
Labels
No labels