I need to validate US SSN number. Currently I have below rules:
- Should be 9 digits long.
- Not allowed are SSNs with all zeros in any digit group (000-xx-####, ###-00-####, ###-xx-0000).
- Not allowed are SSNs with Area Numbers (First 3 digits) 000, 666 and 900-999.
- Not allowed are SSNs from 987-65-4320 to 987-65-4329.
And there are few rules to validate Group Code(-xx-). I have verified in below Site but I 开发者_JS百科couldn't understand the logic of "Group Code"?
http://www.codeproject.com/KB/validation/ssnvalidator.aspx
The SSA changed the rules for issuance of SSNs effective June 25, 2011. See http://www.ssa.gov/employer/randomization.html.
The rules for SSNs issued until the day before are outlined here: http://www.ssa.gov/employer/ssnweb.htm
I suppose that for SSNs to be accurately validated, you would need to know their issuance dates. Prior to June 25, 2011, use the old rules. On June 25, 2011 or after, use the new rules.
精彩评论