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

Codecs could drop leading zeros/ones from constrained integer bytes before constructing the type #310

Open
Nicceboy opened this issue Sep 5, 2024 · 0 comments
Labels
area/codec Related to a new or existing ASN.1 codec. area/types Related to rasn’s types for ASN.1 help wanted Extra attention is needed kind/enhancement New feature or request

Comments

@Nicceboy
Copy link
Contributor

Nicceboy commented Sep 5, 2024

Sometimes when decoding constrained integer types, it is acceptable for the codec that there are many leading zeros or ones which do not actually affect for the integer value.

When the constrained integer type is not using Rust integer primitive types directly, but rather the new variable-sized Integer type, decoding could get small performance benefits if those bytes are dropped. This would result into increased usage of the internal isize type rather than allocated BitInt type, particularly on 32-bit platforms.

@XAMPPRocky XAMPPRocky added kind/enhancement New feature or request help wanted Extra attention is needed area/codec Related to a new or existing ASN.1 codec. area/types Related to rasn’s types for ASN.1 labels Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codec Related to a new or existing ASN.1 codec. area/types Related to rasn’s types for ASN.1 help wanted Extra attention is needed kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants