Bogus icon indicating copy to clipboard operation
Bogus copied to clipboard

United Kingdom Extensions: Added NHSNumber generator to Person

Open JohnStabler opened this issue 2 years ago • 1 comments

NHS numbers at 10 digits long. The last digit is a check digit

JohnStabler avatar Jul 13 '23 12:07 JohnStabler

Hi. I think we need a unit test for this. Also, is there a way to generate an NHS number without the do/while loop?

Generally, it's a bad/anti-pattern for generators to have a do -> while -> test-if-valid -> do-again-if-not-valid in Bogus.

A better implementation would be a straight one-shot generation of the NHS number after calling the generation method.

bchavez avatar Jan 14 '24 00:01 bchavez