This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule CheckDigit do | |
import Enum | |
@doc """ | |
Determine if a sequence of digits is valid, assuming the last digit is | |
a Luhn checksum. (http://en.wikipedia.org/wiki/Luhn_algorithm) | |
""" | |
def valid?(numbers) when is_list(numbers) do |