CanadaSin v0.1.0 CanadaSin View Source

Documentation for CanadaSin.

Link to this section Summary

Functions

Gets the province from the first digit

Validates if a SIN matches Canadian’s rules

Link to this section Functions

Link to this function province(number) View Source
province(integer()) :: [atom()]
province(String.t()) :: [atom()]

Gets the province from the first digit

Examples

iex> CanadaSin.province "130 692 544"
[:NB, :NF, :NS, :PE]

iex> CanadaSin.province 230692544
[:QC]
Link to this function valid?(number) View Source
valid?(integer()) :: boolean()
valid?(String.t()) :: boolean()

Validates if a SIN matches Canadian’s rules

Examples

iex> CanadaSin.valid? "130 692 544"
true

iex> CanadaSin.valid? 130692544
true