Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 977 Bytes

README.md

File metadata and controls

41 lines (27 loc) · 977 Bytes

elm-ssn-validation

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.

Available SSNs

Language Validation Normalization
🇸🇪 Swedish (personnummer)

Installation

elm-package install ahstro/elm-ssn-validation

Usage

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.