-
Notifications
You must be signed in to change notification settings - Fork 772
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
refactor(experimental): add padLeftCodec and padRightCodec helpers to @solana/codecs-core #2314
Conversation
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @lorisleiva and the rest of your teammates on Graphite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge activity
|
0534171
to
be1301f
Compare
… @solana/codecs-core
ac6badb
to
f783650
Compare
🎉 This PR is included in version 1.91.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
This PR adds new
padLeftCodec
andpadRightCodec
helper functions. See copy/pasted documentation below:Padding codecs
The
padLeftCodec
andpadRightCodec
helpers can be used to add padding to the left or right of a given codec. They accept anoffset
number that tells us how big the padding should be.Note that both the
padLeftCodec
andpadRightCodec
functions are simple wrappers around theoffsetCodec
andresizeCodec
functions. For more complex padding strategies, you may want to use theoffsetCodec
andresizeCodec
functions directly instead.As usual, encoder-only and decoder-only helpers are available for these padding functions. Namely,
padLeftEncoder
,padRightEncoder
,padLeftDecoder
andpadRightDecoder
.