NAME

SSN::Validate - Perl extension do SSN Validation

SYNOPSIS

use SSN::Validate;

my $ssn = new SSN::Validate;

if ($ssn->valid_ssn("123-45-6789")) {
  print "It's a valid SSN";
}

my $state = $ssn->get_state("123456789");	
my $state = $ssn->get_state("123");	

DESCRIPTION

This module is intented to do some Social Security Number validation (not verification) beyond just seeing if it contains 9 digits and isn't all 0s. The data is taken from the Social Security Admin. website, specifically:

http://www.ssa.gov/foia/stateweb.html

As of this initial version, SSNs are validated by ensuring it is 9 digits, the area, group and serial are not all 0s, and that the area is within a valid range used by the SSA.

It will also return the state which the SSN was issues, if that data is known (state of "??" for unknown states/regions).

A SSN is formed by 3 parts, the area (A), group (G) and serial (S):

AAAA-GG-SSSS

METHODS

valid_ssn($ssn);

The SSN can be of any format (111-11-1111, 111111111, etc...). All non-digits are stripped.

This method will return true if it is valid, and false if it isn't.

valid_area($ssn);

This will see if the area is valid by using the ranges in use by the SSA. You can pass this method a full SSN, or just the 3 digit area.

valid_group($group);

This is currently only making sure the group isn't "00". It will later check the High Groups in use by the SSA for areas.

Right now, this method expects an actual 2 digit group. Later versions will take a full SSN since groups tie together with areas, and the area will be needed to validate the group more than just checking for "00".

So, this method is only semi-useful right now to you. High Groups are shown here:

http://www.ssa.gov/foia/highgroup.htm

Patches welcome!

valid_serial($serial);

This is currently only making sure the serial isn't "0000", and that's all it will ever do. From my reading, "0000" is the only non-valid serial.

This is also semi-useful right now, as it expects only 4 digits. Later it will take both 4 digits or a full serial.

get_state($ssn);

You can give this a full SSN or 3 digit area. It will return the state, if known, from where the given area is issued.

get_description($ssn);

If there is a description associated with the state or region, this will return it.. or will return an empty string.

TODO

* Change how the data is stored. I don't like how it is done now... but works. * Add verification of valid High Groups. * Find out state(s) for areas which aren't known right now.

EXPORT

None by default.

AUTHOR

Kevin Meltzer, <kmeltz@cpan.org<gt>

SEE ALSO

perl.