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

feat: add optional offset param to varint.decode #201

Merged
merged 2 commits into from
Sep 20, 2022

Conversation

Gozala
Copy link
Contributor

@Gozala Gozala commented Sep 15, 2022

Adds optional offset parameter to varint.decode to allow decoding varints at arbitrary offsets without having to create intermediary Uint8Arrays.

Whenever I have to deal with format that puts multiple varints e.g. <code><size><bytes> I find myself having to read first varint then to read second I'm forced to create another Uint8Array view. With this change it would be possible to just specify offset and avoid creating unnecessary objects.

@Gozala Gozala requested a review from rvagg September 15, 2022 07:18
@rvagg rvagg merged commit 1e1b583 into master Sep 20, 2022
@rvagg rvagg deleted the feat/varint-decode-offset branch September 20, 2022 04:02
github-actions bot pushed a commit that referenced this pull request Sep 20, 2022
## [9.9.0](v9.8.1...v9.9.0) (2022-09-20)

### Features

* add optional offset param to varint.decode ([#201](#201)) ([1e1b583](1e1b583))
@github-actions
Copy link

🎉 This PR is included in version 9.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants