__construct()
+__construct()
__construct() : \CodeValidator
Constructor.
@@ -330,7 +322,7 @@Tags
IsValidISBN()
+IsValidISBN()
IsValidISBN(string $code = '') : boolean
Determine whether an ISBN code is valid (either ISBN 10 or 13 digits). It also validates whether the code has the right length.
@@ -371,7 +363,7 @@Tags
IsValidEAN8()
+IsValidEAN8()
IsValidEAN8(string $code = '') : boolean
Determine whether a EAN-8 (GTIN-8) code is valid
@@ -418,15 +410,15 @@Tags
IsValidEAN13()
+IsValidEAN13()
IsValidEAN13(string $code = '') : boolean
Determine whether a EAN-13 (GTIN-13) code is valid
The EAN barcode is primarily used in supermarkets to identify product at the point of sales. The products contain the EAN number or GTIN (Global Trade Item Number) to identify itself.
An EAN-13 always has 13 digits:
-
-
- GS1 Prefix: The first 3 digits - usually identifying the national GS1 Member Organization to which the manufacturer is registered (not necessarily where the product is actually made). The GS1 Prefix is 978 or 979, when the EAN-13 symbol encodes a conversion of an International Standard Book Number (ISBN). -Likewise the prefix is 979 for International Standard Music Number (ISMN) and 977 for International Standard Serial Number (ISSN). +
- GS1 Prefix: The first 3 digits - usually identifying the national GS1 Member Organization to which the manufacturer is registered (not necessarily where the product is actually made). The GS1 Prefix is equal to 978 when the EAN-13 symbol encodes a conversion of an International Standard Book Number (ISBN). +Likewise the prefix is equal to 979 for International Standard Music Number (ISMN) and 977 for International Standard Serial Number (ISSN).
- Manufacturer Code: The manufacturer code is a unique code assigned to each manufacturer by the numbering authority indicated by the GS1 Prefix. All products produced by a given company will use the same manufacturer code.
- Product Code: The product code is assigned by the manufacturer. The product code immediately follows manufacturer code. The total length of manufacturer code plus product code should be 9 or 10 digits depending on the length of country code(2-3 digits).
- Check digit: The check digit is an additional digit, used to verify that a barcode has been entered correctly. @@ -465,7 +457,7 @@
Tags
IsValidEAN14()
+IsValidEAN14()
IsValidEAN14(string $code = '') : boolean
Determine whether a EAN-14 code is valid
@@ -510,7 +502,7 @@Tags
IsValidUPCA()
+IsValidUPCA()
IsValidUPCA(string $code = '') : boolean
Determine whether a UPC-A code is valid
@@ -568,7 +560,7 @@Tags
IsValidUPCE()
+IsValidUPCE()
IsValidUPCE(string $code = '') : boolean
Determine whether a UPC-E code is valid
@@ -622,7 +614,7 @@Tags
IsValidGSIN()
+IsValidGSIN()
IsValidGSIN(string $code = '') : boolean
Determine whether a GSIN code is valid.
@@ -668,7 +660,7 @@Tags
IsValidSSCC()
+IsValidSSCC()
IsValidSSCC(string $code = '') : boolean
Determine whether a SSCC code is valid.
@@ -715,7 +707,7 @@Tags
IsValidGLN()
+IsValidGLN()
IsValidGLN(string $code = '') : boolean
Determine whether a GLN code is valid
@@ -755,7 +747,7 @@Tags
IsValidIMEI()
+IsValidIMEI()
IsValidIMEI(string $code = '') : boolean
Determine whether an IMEI number is valid or IMEISV
@@ -797,7 +789,7 @@Tags
calculateEANCheckDigit()
+calculateEANCheckDigit()
calculateEANCheckDigit(string $code) : integer
Calculate a check digit using the Modulo-10 algorithm used for EAN/UPC/GTIN codes.
@@ -837,7 +829,7 @@Tags
validateEANCheckDigit()
+validateEANCheckDigit()
validateEANCheckDigit(string $code, integer $length) : boolean
Determine whether a code is valid using the check-digit algorithm. It also validates whether the code has the right length and that it's composed of only digits.
@@ -882,7 +874,7 @@Tags
sumAllDigits()
+sumAllDigits()
sumAllDigits(integer $number, integer $index) : array
Replace a number by the sum of all its digits.
@@ -924,7 +916,7 @@Tags
calculateLuhnCheckDigit()
+calculateLuhnCheckDigit()
calculateLuhnCheckDigit(string $code) : integer
Calculate a check digit using the Luhn Modulo-10 algorithm used for IMEI, Credit Card validation and others.
@@ -1033,7 +1025,7 @@Tags
validateLuhnCheckDigit()
+validateLuhnCheckDigit()
validateLuhnCheckDigit(string $code, integer $length) : boolean
Determine whether a code is valid using the Luhn algorithm. It also validates whether the code has the right length and that it's composed of only digits.
@@ -1077,7 +1069,7 @@Tags
calculateISBNCheckDigit()
+calculateISBNCheckDigit()
calculateISBNCheckDigit(string $code) : mixed
Calculate a check digit using the ISBN algorithm. The ISBN is error-detecting, but not error-correcting (unless it is known that only a single digit is erroneous). The ISBN detects any single-digit error, as well as most two-digit error resulting from transposing two digits.
@@ -1167,11 +1159,11 @@Tags
validateISBNCheckDigit()
+validateISBNCheckDigit()
-validateISBNCheckDigit(string $code, integer $length = 13) : boolean-
Determine whether a code is valid using the ISBN algorithm (either ISBN 10 or 13 digits). It also validates whether the code has the right length.
-For ISBN-10 each of the first nine digits of the ten-digit ISBN (excluding the check digit itself) is multiplied by a number in a sequence from 10 to 2 and the remainder of the sum with (respect to 11) is computed. The resulting remainder, plus the check digit, must equal a multiple of 11 (either 0 or 11). For ISBN-13 the check-digit is calculated using the CodeValidator::calculateEANCheckDigit() function, making it compatible with EAN codes.
+validateISBNCheckDigit(string $code) : boolean
+ Determine whether a code is valid using the ISBN algorithm (either ISBN 10). It also validates whether the code has the right length.
+For ISBN-10 each of the first nine digits of the ten-digit ISBN (excluding the check digit itself) is multiplied by a number in a sequence from 10 to 2 and the remainder of the sum with (respect to 11) is computed. The resulting remainder, plus the check digit, must equal a multiple of 11 (either 0 or 11).
Parameters
string | $code | the code to validate |
-
-
integer | -$length | -The length of the ISBN code to validate (either 10 or 13 digits) |
- Documentation is powered by phpDocumentor and authored by Iván Melgrati - on February 25th, 2018 at 04:37. + Documentation is powered by phpDocumentor and authored by Iván Melgrati on February 25th, 2018 at 16:44.