C# Class Faker.Code

A collection of Code related resources.
Exibir arquivo Open project: AdmiringWorm/Faker.NET.Portable

Public Methods

Method Description
EAN ( bool validChecksum = true ) : string

Generates a EAN Code

Description of the EAN standard is at Checksum routines are at

FiscalCode ( bool validChecksum = true ) : string

Generates an Italian Fiscal Code

Description of the Fiscal Code standard is at https://en.wikipedia.org/wiki/Italian_fiscal_code_card

FiscalCode ( bool validChecksum, int minAge, int maxAge ) : string

Generates an Italian Fiscal Code

Description of the Fiscal Code standard is at https://en.wikipedia.org/wiki/Italian_fiscal_code_card

FiscalCode ( int minAge, int maxAge ) : string

Generates an Italian Fiscal Code

Description of the Fiscal Code standard is at https://en.wikipedia.org/wiki/Italian_fiscal_code_card

FiscalCode ( string lastName, string firstName, System.DateTime birthday, bool validChecksum = true ) : string

Generates an Italian Fiscal Code

Description of the Fiscal Code standard is at https://en.wikipedia.org/wiki/Italian_fiscal_code_card

ISBN10 ( bool validChecksum = true ) : string

Generates an ISBN-10 Code

Description of the ISBN standard is at Checksum routines are at

ISBN13 ( bool validChecksum = true ) : string

Generates an ISBN-13 Code

Description of the ISBN standard is at Checksum routines are at

NPI ( ) : string

Generates a 10 digit NPI (National Provider Identifier issued to health care providers in the United States)

Description of the NPI standard is at https://en.wikipedia.org/wiki/National_Provider_Identifier. The NPI has replaced the unique physician identification number (UPIN).

NRIC ( bool validChecksum = true, int minAge = 18, int maxAge = 65 ) : string

Generates a Singaporean National Registration Identity Card (NRIC) for holder who is born between specified ages.

Description of the NRIC standard is at . This ID was issued for the first time in 1965 in Singapore. See also:

RUT ( bool validChecksum = true ) : string

Generates a RUT Code

Description of the RUT standard is at Checksum routines are at

Private Methods

Method Description
ComputeChecksumEan ( int digits ) : int
ComputeChecksumFiscalCode ( string prefix, bool validChecksum ) : char
ComputeChecksumIsbn10 ( int digits ) : int
ComputeChecksumNric ( int digits, char prefix, bool validChecksum ) : char
ComputeChecksumRut ( int digits ) : int
GetFiscalCodeSqueezedName ( string name, bool isFirstName ) : string

This method applies the rule giving the consonants and vowels extracted by the name, according to the algorithm.

IsVowel ( char c ) : bool

Method Details

EAN() public static method

Generates a EAN Code
Description of the EAN standard is at Checksum routines are at
public static EAN ( bool validChecksum = true ) : string
validChecksum bool /// Indicates whether the generated EAN has a valid checksum or not ///
return string

FiscalCode() public static method

Generates an Italian Fiscal Code
Description of the Fiscal Code standard is at https://en.wikipedia.org/wiki/Italian_fiscal_code_card
public static FiscalCode ( bool validChecksum = true ) : string
validChecksum bool /// Indicates whether the generated Fiscal Code has a valid checksum or not ///
return string

FiscalCode() public static method

Generates an Italian Fiscal Code
Description of the Fiscal Code standard is at https://en.wikipedia.org/wiki/Italian_fiscal_code_card
public static FiscalCode ( bool validChecksum, int minAge, int maxAge ) : string
validChecksum bool /// Indicates whether the generated Fiscal Code has a valid checksum or not ///
minAge int Minimum age of the holder
maxAge int Maximum age of the holder
return string

FiscalCode() public static method

Generates an Italian Fiscal Code
Description of the Fiscal Code standard is at https://en.wikipedia.org/wiki/Italian_fiscal_code_card
public static FiscalCode ( int minAge, int maxAge ) : string
minAge int Minimum age of the holder
maxAge int Maximum age of the holder
return string

FiscalCode() public static method

Generates an Italian Fiscal Code
Description of the Fiscal Code standard is at https://en.wikipedia.org/wiki/Italian_fiscal_code_card
public static FiscalCode ( string lastName, string firstName, System.DateTime birthday, bool validChecksum = true ) : string
lastName string Last name of the holder
firstName string First name of the holder
birthday System.DateTime Birthday of the holder
validChecksum bool /// Indicates whether the generated Fiscal Code has a valid checksum or not ///
return string

ISBN10() public static method

Generates an ISBN-10 Code
Description of the ISBN standard is at Checksum routines are at
public static ISBN10 ( bool validChecksum = true ) : string
validChecksum bool /// Indicates whether the generated ISBN has a valid checksum or not ///
return string

ISBN13() public static method

Generates an ISBN-13 Code
Description of the ISBN standard is at Checksum routines are at
public static ISBN13 ( bool validChecksum = true ) : string
validChecksum bool /// Indicates whether the generated ISBN has a valid checksum or not ///
return string

NPI() public static method

Generates a 10 digit NPI (National Provider Identifier issued to health care providers in the United States)
Description of the NPI standard is at https://en.wikipedia.org/wiki/National_Provider_Identifier. The NPI has replaced the unique physician identification number (UPIN).
public static NPI ( ) : string
return string

NRIC() public static method

Generates a Singaporean National Registration Identity Card (NRIC) for holder who is born between specified ages.
Description of the NRIC standard is at . This ID was issued for the first time in 1965 in Singapore. See also:
public static NRIC ( bool validChecksum = true, int minAge = 18, int maxAge = 65 ) : string
validChecksum bool /// Indicates whether the generated NRIC has a valid checksum or not ///
minAge int Minimum age of the holder
maxAge int Maximum age of the holder
return string

RUT() public static method

Generates a RUT Code
Description of the RUT standard is at Checksum routines are at
public static RUT ( bool validChecksum = true ) : string
validChecksum bool /// Indicates whether the generated RUT has a valid checksum or not ///
return string