J8k3 0da4c99a0c Fix PAN generation: random prefix within range, Mastercard series option
Two bugs in generateBrandPan:
1. For networks with multiple prefix rules, always picked the same rule
   (Mastercard always 2-series, AmEx always 37, Discover always 6011)
2. Always used the start of the range as the prefix, so Mastercard
   generated 51xxxxx or 2221xxxxxx every time instead of any value
   in 51-55 or 2221-2720

Fix both: pick a random prefix rule and a random prefix within start..end.

Add a "Mastercard series" arg to PAN Generate so callers can explicitly
request 5-series (51-55), 2-series (2221-2720), or leave it random.
The curated sample path is unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 14:18:22 -04:00
..
2026-05-09 11:57:41 +01:00
2026-05-16 10:21:26 -04:00