Skip to content

Instantly share code, notes, and snippets.

@ebluehands
ebluehands / LunhModN.swift
Last active December 18, 2015 08:32
This is an implementation of the Luhn mod N algorithm. A repo is also available : https://github.com/ebluehands/LuhnModN
import Darwin
enum LuhnError : ErrorType {
case InvalidCharacters
case ModuloOutOfRange
}
/// This is an implementation of the [Luhn mod N algorithm](https://en.wikipedia.org/wiki/Luhn_mod_N_algorithm)
public class LuhnModN {