Skip to main content

is_valid_ssn_programmatically

Function is_valid_ssn_programmatically 

Source
pub fn is_valid_ssn_programmatically(ssn: &str) -> bool
Expand description

Helper function to validate SSN based on US Social Security Administration rules.

This implementation aims for a robust programmatic check without external data. It validates the structural components against known invalid patterns.

§Arguments

  • ssn - The SSN string slice to validate. Expected format “XXX-XX-XXXX”.

§Returns

true if the SSN passes basic structural and invalid pattern checks, false otherwise.