carlsson87/mod10/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Mod10

This library helps you create and verify numeric strings according to the Modulus 10 algorithm.

Verify

verify : String -> Bool

Verfify a numeric string with the Modulus 10 algorithm.

verify "79927398713" == True
verify "79927398712" == False
verify "nonsense" == False

Calculate

calculate : String -> Maybe Char

Calculate the "check digit" for a numeric string.

calculate "7992739871" == Just '3'
calculate "nonsense" == Nothing