Packagevegas.string
Classpublic class Luhn

It is a simple checksum formula used to validate a variety of account numbers, such as credit card numbers, etc.

The Luhn algorithm or Luhn formula, also known as the "modulus 10" or "mod 10" algorithm, was developed in the 1960s as a method of validating identification numbers.

example

See Luhn Formula

     import vegas.string.Luhn ;
     
     var code:String = "456565654" ;
     trace (code + " isValid : " + Luhn.isValid(code)) ;
     



Public Methods
 MethodDefined by
  
isValid(str:String):Boolean
[static] Returns true if the expression in argument is a valid Luhn value.
Luhn
Method detail
isValid()method
public static function isValid(str:String):Boolean

Returns true if the expression in argument is a valid Luhn value.

Parameters
str:String

Returns
Booleantrue if the expression in argument is a valid Luhn value.