2017 © Pedro PelĂĄez
 

library checkdigit

Helper classes to calculate and validate ckecksums

image

byrokrat/checkdigit

Helper classes to calculate and validate ckecksums

  • Tuesday, December 5, 2017
  • by hanneskod
  • Repository
  • 1 Watchers
  • 6 Stars
  • 27,152 Installations
  • PHP
  • 2 Dependents
  • 1 Suggesters
  • 3 Forks
  • 0 Open issues
  • 7 Versions
  • 8 % Grown

The README.md

ABANDONED! This package is discontinued and will not be updated., (*1)

Checkdigit

Packagist Version Build Status Quality Score Scrutinizer Coverage, (*2)

Helper classes to calculate and validate ckecksums., (*3)

Installation

composer require byrokrat/checkdigit

Checkdigit requires the bcmath php extension., (*4)

API

The Calculator interface defines two methods:, (*5)

  • isValid(string $number): bool checks if number contains a valid check digit.
  • calculateCheckDigit(string $number): string calculates the check digit for number.

Implementations include:, (*6)

  • Modulo10 and Luhn for modulo 10 check digits (Luhn is simply a shorthand for Modulo10).
  • Modulo10Gtin for modulo 10 check digits variant used in GTIN barcodes.
  • Modulo11 for modulo 11 check digits.
  • Modulo97 for modulo 97 check digits.

Usage

$luhn = new byrokrat\checkdigit\Luhn;

// outputs '1' (true)
echo $luhn->isValid('55555551');

// outputs '' (false)
echo $luhn->isValid('55555550');

// outputs '1'
echo $luhn->calculateCheckDigit('5555555');

The Versions

05/12 2017

dev-master

9999999-dev https://github.com/byrokrat/checkdigit

Helper classes to calculate and validate ckecksums

  Sources   Download

WTFPL Unlicense

The Requires

  • ext-bcmath *
  • php >=7.0

 

by Hannes ForsgÄrd

luhn check digit modulo 10 modulo 11 modulo 97

05/12 2017

2.0.0

2.0.0.0 https://github.com/byrokrat/checkdigit

Helper classes to calculate and validate ckecksums

  Sources   Download

Unlicense

The Requires

  • php >=7.0
  • ext-bcmath *

 

by Hannes ForsgÄrd

luhn check digit modulo 10 modulo 11 modulo 97

04/12 2017

1.2.0

1.2.0.0 https://github.com/byrokrat/checkdigit

Helper classes to calculate and validate ckecksums

  Sources   Download

Unlicense

The Requires

  • php >=7.0
  • ext-bcmath *

 

by Hannes ForsgÄrd

luhn check digit modulo 10 modulo 11 modulo 97

18/08 2016

1.1.2

1.1.2.0 https://github.com/byrokrat/checkdigit

Helper classes to calculate and validate ckecksums

  Sources   Download

WTFPL

The Requires

  • php >=5.4
  • ext-bcmath *

 

by Hannes ForsgÄrd

luhn check digit modulo 10 modulo 11 modulo 97

04/05 2016

1.1.1

1.1.1.0 https://github.com/byrokrat/checkdigit

Helper classes to calculate and validate ckecksums

  Sources   Download

WTFPL

The Requires

  • php >=5.4
  • ext-bcmath *

 

by Hannes ForsgÄrd

luhn check digit modulo 10 modulo 11 modulo 97

02/03 2016

1.1.0

1.1.0.0 https://github.com/byrokrat/checkdigit

Helper classes to calculate and validate ckecksums

  Sources   Download

WTFPL

The Requires

  • php >=5.4
  • ext-bcmath *

 

The Development Requires

by Hannes ForsgÄrd

luhn check digit modulo 10 modulo 11 modulo 97

26/01 2015

1.0.0

1.0.0.0 https://github.com/byrokrat/checkdigit

Helper classes to calculate and validate ckecksums

  Sources   Download

WTFPL

The Requires

  • php >=5.4
  • ext-bcmath *

 

by Hannes ForsgÄrd

luhn check digit modulo 10 modulo 11 modulo 97