C# Класс NContrib.Luhn

Generates and validates Luhn numbers http://en.wikipedia.org/wiki/Luhn_algorithm
Показать файл Открыть проект

Открытые методы

Метод Описание
Generate ( int length ) : string

Generates a number that passes Luhn validation

Generate ( int length, string seed ) : string

Generates a number that passes Luhn validation. Number starts with the specified seed value

IsValid ( string number ) : bool

Checks to see if this number as a string passes a Luhn check

Описание методов

Generate() публичный статический Метод

Generates a number that passes Luhn validation
public static Generate ( int length ) : string
length int
Результат string

Generate() публичный статический Метод

Generates a number that passes Luhn validation. Number starts with the specified seed value
public static Generate ( int length, string seed ) : string
length int Total length of the number to generate
seed string Optional numbers with which to seed the sequence
Результат string

IsValid() публичный статический Метод

Checks to see if this number as a string passes a Luhn check
public static IsValid ( string number ) : bool
number string Number as a string to check
Результат bool