This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0
Validate social security numbers
version 1.1.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.1.0
Committed At 2018-01-04 17:03:47 UTC
elm-lang/core 5.0.0 <= v < 6.0.0 5.1.1
ahstro/elm-luhn 1.0.0 <= v < 2.0.0 1.0.0

README

elm-ssn-validation

Validate (currently only Swedish) social security numbers (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.