C# Class NContrib.Luhn

Generates and validates Luhn numbers http://en.wikipedia.org/wiki/Luhn_algorithm
Afficher le fichier Open project: veracross/ncontrib

Méthodes publiques

Méthode Description
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

Method Details

Generate() public static méthode

Generates a number that passes Luhn validation
public static Generate ( int length ) : string
length int
Résultat string

Generate() public static méthode

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
Résultat string

IsValid() public static méthode

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
Résultat bool