Skip to content

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

Merged
rvagg merged 2 commits intomasterfrom
feat/varint-decode-offset
Sep 20, 2022
Merged

feat: add optional offset param to varint.decode#201
rvagg merged 2 commits intomasterfrom
feat/varint-decode-offset

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