Matt Mayer
Matt Mayer
#2195 still seems like the best way to handle this. We could have a page in the docs explaining how to plug in pure-rand (or other popular libraries) to make...
Changing the default random generator should definitely be v9. Allowing opt in to a 53 bit mersenne generator using #2195 could be in v8.
Agreed. Changing the mersenne implementation causes every faker method to return different values for a fixed seed so it should definitely be considered a breaking change.
It does seem like faker.number.int returns more duplicates than expected for large max. If every int was equally likely to be selected, you would expect fewer duplicates as the max...
This makes sense, as mersenne twister implementation returns around 2^32 seperate values which is approx 10^10, several orders of magnitude less than Number.MAX_SAFE_INTEGER
If you uniformly draw a random number uniformly from [1…N] with replacement the expected number of draws before you get a repeat is approx `sqrt(pi/2*N)` so for a mersenne twister...
I ran a large number of generated numbers through `validator.isCreditCard`. First the general check (no provider) ``` { mastercard: { valid: 91151, invalid: 0 }, jcb: { valid: 90173, invalid:...
There are six patterns for `discover` in Faker. These two succeed: ``` 65##-####-####-###L 6011-####-####-###L ``` These four fail: ``` A) 6011-62##-####-####-###L B) 64[4-9]#-62##-####-####-###L C) 65##-62##-####-####-###L D) 64[4-9]#-####-####-###L ``` For reference...
In order to properly support `maestro`, this would need to be added to validator. According to Wikipedia Maestro cards are 12-19 digits long and start with one of these prefixes:...
`mastercard` has two patterns in Faker. Both pass the general `isCreditCard` check but `5[1-5]##-####-####-###L' succeeds but '6771-89##-####-###L' fails. The validator regex is `/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/` This seems to be a weird edge...