r/webdev • • 1h ago

Standard identifiers for PHP

https://php-stdnum.org/

I've released an open-source PHP library for validating, normalizing and generating standardized identifiers.

It covers 606 identifier types - VAT numbers, IBANs, company registration numbers, national identifiers and postal codes.

It also includes 594 test-data generators and optional integrations with Laravel, Symfony, Doctrine and FakerPHP.

Documentation and searchable catalogue: https://php-stdnum.org/

Source code: https://github.com/php-stdnum/php-stdnum

Feedback is welcomed.

Thank you!

0 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/Worried_Librarian_79 33m ago

The library supports both. Isbn10::fake() uses a random seed, while Isbn10::fake(seed: 42) produces reproducible results.

Random generation is useful for general test data, while deterministic generation for reproducible fixtures, regression tests and debugging.

Regarding long-term maintenance, it will be a challenge.

One of the reasons I started this project was that I couldn't find a PHP equivalent to stdnum-js with comparable coverage. The backend needed multiple dependencies, while the frontend needed just one.

Hopefully, if the community finds it useful, others will help maintain and improve it over time.