StefH / RandomDataGenerator

This is a configurable generator to create random data like Lorum Ipsum Text, Words, Text Patterns, First/Last Names, MAC-Addresses, IP-Addresses, Guids and DateTime.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Credit card numbers

gderosa opened this issue · comments

Implementing something that would allow this

IRandomizerString randomizerCCN = RandomizerFactory.GetRandomizer(new FieldOptionsCCN { });

would be really nice to have. It should comply with Luhn algorithm etc.

Good idea.

Do you have any technical details on this?

Not much at the moment (other than what we con google/wikipedia for). I know / I've heard of the Luhn algorithm but not sure if complying with it will be sufficient, or there are other necessary checks to ensure a number is valid in principle. We can do some more research and I'll update here if I have more details.

@gderosa
I think this library https://github.com/gustavofrizzo/CreditCardValidator can be included in RandomDataGenerator to support CCN.

I'll take a look.

@gderosa
It's implemented, a new version will be published to NuGet in some time.

@StefH excellent job, thank you very much!!