Lggr
Static Public Member Functions | List of all members
Faker\Calculator\Luhn Class Reference

Static Public Member Functions

static computeCheckDigit ($partialNumber)
 
static isValid ($number)
 
static generateLuhnNumber ($partialValue)
 

Detailed Description

Utility class for generating and validating Luhn numbers.

Luhn algorithm is used to validate credit card numbers, IMEI numbers, and National Provider Identifier numbers.

See also
http://en.wikipedia.org/wiki/Luhn_algorithm

Member Function Documentation

◆ computeCheckDigit()

static Faker\Calculator\Luhn::computeCheckDigit (   $partialNumber)
static
Parameters
$partialNumber
Returns
string

◆ generateLuhnNumber()

static Faker\Calculator\Luhn::generateLuhnNumber (   $partialValue)
static

Generate a Luhn compliant number.

Parameters
string$partialValue
Returns
string

◆ isValid()

static Faker\Calculator\Luhn::isValid (   $number)
static

Checks whether a number (partial number + check digit) is Luhn compliant

Parameters
string$number
Returns
bool

The documentation for this class was generated from the following file: