arthurdejong / python-stdnum

A Python library to provide functions to handle, parse and validate standard numbers.
https://arthurdejong.org/python-stdnum/
GNU Lesser General Public License v2.1
484 stars 203 forks source link

Wrong UA edrpou validation for some valid codes #429

Closed sector119 closed 3 months ago

sector119 commented 4 months ago

Hello

I have some valid edrpou codes, but is_valid from stdnum.ua.edrpou returns False

41761770 25083040 23246880 43808820 43328020 43573920 40599600

I can find them at Ukrainian open data catalogue. For example https://opendatabot.ua/c/43808820

For all that codes calc_check_digit() returns 10, but we should compare number[-1] with 0, not with 10 at this case.

arthurdejong commented 3 months ago

Hi @sector119,

Thanks for pointing this out and providing test cases, that is really useful! The bug has been fixed in bb20121.