C# 클래스 NContrib.Luhn

Generates and validates Luhn numbers http://en.wikipedia.org/wiki/Luhn_algorithm
파일 보기 프로젝트 열기: veracross/ncontrib

공개 메소드들

메소드 설명
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