mercredi 23 juin 2021

Generate unique Social Security Numbers [closed]

I want to automatically generate lots of faux Social Security Numbers in Python.

My thoughts are to use regular expressions (for formatting) and random.seed(69420) to ensure that not one SSN is generated more than once ever.

So far, I have:

import re

import random
random.seed(69420)

ssn_pattern = re.compile(r'^\d\d\d-\d\d-\d\d\d\d$')

I don't want to use it in a for loop; but rather invoke it (in a live program I hope to have) as I please the once and it still be completely unique (for that given runtime).

How do I generate the regular expression in one line?

How do I make use of random seed on this operation?




Aucun commentaire:

Enregistrer un commentaire