Have a SSN option would be great.
This would be en_US only?
Would you provide the full range, or have the option to get back specific numbers based on date or region?
Will accept a PR for this.
I've been using faker.phone.phoneNumber('#########') as a workaround!
馃憤
Why would this be restricted to a single locale? In the Netherlands we also have a SSN, although it does have a different name in dutch (burgerservicenummer / bsn).
But why would this be handled differently than a postal code?
http://faker.hook.io/?property=address.zipCode&locale=nl -> 9203 AB
http://faker.hook.io/?property=address.zipCode&locale=de -> 66719
I vote for using the existing mechanism:
http://faker.hook.io/?property=person.ssn&locale=us -> 421450174 or 421-45-0174
http://faker.hook.io/?property=person.ssn&locale=nl -> 111222333 or 111.222.333
The usage of person is just a namespace I thought of, it could be located in an existing namespace like name.
I know the US Social Security has a particular validation structure that would need to be followed, I assume the Netherlands has the same sort of rules.
Can we assume this faker will only generate "valid" numbers?
https://en.wikipedia.org/wiki/Social_Security_number#Structure
I've been using
faker.phone.phoneNumber('#########')as a workaround!
Agree. This is a very easy workaround and the feature would only be relevant to US developers.
Add dashes if you care to faker.phone.phoneNumber("###-##-####")
In Brazil, the Social Security Number equivalent is called Cadastro de Pessoa Fisica, or CPF for short. There's the handy node-cpf package that generates valid CPF numbers, and also deals with masking and unmasking.
For the specific pt_BR locale, it would be simple to implement this SSN method by relying on the node-cpf package, and I believe the community could handle implementing validators for the other locales (if there's none already available). Speaking for myself, I would be glad to help :)
Most helpful comment
馃憤
Why would this be restricted to a single locale? In the Netherlands we also have a SSN, although it does have a different name in dutch (burgerservicenummer / bsn).
But why would this be handled differently than a postal code?
http://faker.hook.io/?property=address.zipCode&locale=nl->9203 ABhttp://faker.hook.io/?property=address.zipCode&locale=de->66719I vote for using the existing mechanism:
http://faker.hook.io/?property=person.ssn&locale=us->421450174or421-45-0174http://faker.hook.io/?property=person.ssn&locale=nl->111222333or111.222.333The usage of
personis just a namespace I thought of, it could be located in an existing namespace likename.