Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add byte decoder #3

Merged
merged 1 commit into from
Apr 12, 2023
Merged

Add byte decoder #3

merged 1 commit into from
Apr 12, 2023

Conversation

lcswillems
Copy link
Contributor

@lcswillems lcswillems commented Apr 10, 2023

Supports uint, biguint, string, boolean, tuple, list. With top-level & nested encoding.

In order to test the decoder, uncomment the commented lines at the end of utils/utils_decode.py and run:

python3 utils/utils_decode.py

This would decode 000000030c0d0e00000007626f6e6a6f7572000000010c using given decoder:

d.Tuple({
    "a": d.List(d.U8()),
    "b": d.Tuple({
        "a": d.Str(),
        "b": d.U(),
    })
})

And output will be:

{'a': [12, 13, 14], 'b': {'a': 'bonjour', 'b': 12}}

@ovidiuolteanu ovidiuolteanu merged commit 3c45777 into main Apr 12, 2023
@lcswillems lcswillems deleted the feat-decoder branch April 12, 2023 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants