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

fix!: remove data hash argument from ItaxCode.valid? and ItaxCode::Validator#valid? #30

Merged
merged 2 commits into from
Oct 1, 2023

Conversation

matteoredz
Copy link
Owner

@matteoredz matteoredz commented Sep 30, 2023

Fixes #29


This PR introduces a breaking change, so a bump to the next major is necessary.

The .valid? method checks a pre-computed tax code against another one encoded from an user-provided hash of data. This check isn't reliable as it only checks the exact equality between the pre-computed tax code and the newly encoded one, returning false negatives for different but still valid tax codes (including omocodes).

This PR simplifies the validity checks by dropping the data hash argument and validating just the provided tax code leveraging the decoder capabilities.

@matteoredz matteoredz added the bug Something isn't working label Sep 30, 2023
@matteoredz matteoredz self-assigned this Sep 30, 2023
@matteoredz matteoredz merged commit 997f8b0 into main Oct 1, 2023
7 checks passed
@matteoredz matteoredz deleted the fix-issue-29 branch October 1, 2023 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ItaxCode.valid? ritorna false per omocodia cittadini estere
1 participant