A few weeks ago, a we fielded a potential request to validate Social Security Numbers. The social security administration has a few rules for numbers that they deem invalid and that they will never assign:
- The first three numbers are {000, 666, 900-999}
- The fourth & fifth numbers are 00
- The last four numbers are 0000
Being one for code reuse, I wanted to do this in as general a way as possible. This was my initial solution (in Mumps/Cache):