Validate social security numbers. If the type of SSN you'd like to validate isn't available, submit an issue or, even better, a pull request.
Language | Validation | Normalization |
---|---|---|
🇸🇪 Swedish (personnummer) | ✅ | ✅ |
elm-package install ahstro/elm-ssn-validation
import Validation.SSN.Swedish as SSN
case SSN.validate "811218-9876" of
Ok ssn ->
ssn ++ " is valid" -- "811218-9876 is valid"
Err error ->
error
if SSN.isValid "811218-9876" then
"Yay"
else
"Nay"
More examples are available in the /tests folder.