Skip to content

add Unpack for unpacking integers.#80

Closed
Vizonex wants to merge 2 commits into
nodejs:mainfrom
Vizonex:binary-parsing
Closed

add Unpack for unpacking integers.#80
Vizonex wants to merge 2 commits into
nodejs:mainfrom
Vizonex:binary-parsing

Conversation

@Vizonex
Copy link
Copy Markdown

@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
    );

@Vizonex
Copy link
Copy Markdown
Author

Vizonex commented May 26, 2026

I think I'm going to close this PR Down and then open a new one I think I like some of the features that the older Pull request did a bit better.

@Vizonex
Copy link
Copy Markdown
Author

Vizonex commented May 26, 2026

I'm closing this because nodejs/llparse-builder#197 Does a better job I'll see about throwing an issue about maintenance if I don't hear anything soon.

@Vizonex Vizonex closed this May 26, 2026
@Vizonex Vizonex deleted the binary-parsing branch May 26, 2026 20:52
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