Skip to content

add Unpack for unpacking integers. #80

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Vizonex
Copy link

@Vizonex Vizonex commented Jul 26, 2025

Based off #32 I decided to try writing a better and simpler approach that is based off MulAdd but for implementing rshifting and lshifting based on weather or not big or little endians are to be used. In my case I'm going to write a new socks5 protocol parser in C.

I have 2 more forks that will be merged since it's a new function and Node class but I've ensured that there is at least some tests available for it. I do have some skills I've learned from contributing to aiohttp and some of it's lower level C/Cython related code so I should be able to navigate things if the C code is wrong or you think it could be better.

I'll upload those pull requests shortly...

Edit: here's a code snippet from one of the tests I added if anybody is confused about how this new code method works

const start = b.node('start');
    b.property('i16', 'unpack_value');
    const unpack_error = b.error(0, 'failed to unpack value');
    const invoke = b.invoke(
      b.code.unpack('unpack_value', Endianess.Little),
      start, unpack_error
    );

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.

1 participant