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

Add better validation of number type and value #13

Merged
merged 2 commits into from
Oct 10, 2022
Merged

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Oct 8, 2022

Closes #10.

This adds better validation for number types ((u)int(n)) and their values.

  • It will check if the type length is within the allowed bounds, i.e., 8 <= n <= 256.
  • It will check if the value to encode is within the byte length of the number type.
  • It will check if the decoded value is within the byte length of the number type.

I've also added some more tests for the number parser.

@Mrtenz Mrtenz requested a review from a team as a code owner October 8, 2022 15:23
@Mrtenz Mrtenz merged commit cfc6684 into main Oct 10, 2022
@Mrtenz Mrtenz deleted the mrtenz/validate-number branch October 10, 2022 09:46
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.

Check that number value fits in specified size
2 participants