PHPackages                             nextgen-tech/gs1-decoder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nextgen-tech/gs1-decoder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nextgen-tech/gs1-decoder
========================

v0.3.1(5y ago)1024.8k—1.3%5[1 issues](https://github.com/nextgen-tech/gs1-decoder/issues)[1 PRs](https://github.com/nextgen-tech/gs1-decoder/pulls)MITPHPPHP ^7.3|^8.0

Since Oct 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/nextgen-tech/gs1-decoder)[ Packagist](https://packagist.org/packages/nextgen-tech/gs1-decoder)[ RSS](/packages/nextgen-tech-gs1-decoder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

GS1-128 (EAN128) Decoder
========================

[](#gs1-128-ean128-decoder)

Basic GS1-128 (EAN128) decoder in PHP.

Installation
------------

[](#installation)

```
composer require nextgen-tech/gs1-decoder
```

Run Tests
---------

[](#run-tests)

```
# run PHPUnit tests
vendor/bin/phpunit

# run PHPStan analyse
vendor/bin/phpstan analyse
```

To run all tests automatically on several platforms you can use [act](https://github.com/nektos/act), which mimics GitHub Actions locally:

```
$ act -P ubuntu-latest=shivammathur/node:latest
```

Usage
-----

[](#usage)

```
use NGT\Barcode\GS1Decoder\Decoder;

$decoder = new Decoder($delimiter = '[FNC1]');
$barcode = $decoder->decode('0195012345678903422616[FNC1]3103000123');

print_r($barcode->toArray());
```

```
Array
(
    [value] => 0195012345678903422616[FNC1]3103000123
    [delimiter] => [FNC1]
    [identifiers] => Array
        (
            [01] => Array
                (
                    [code] => 01
                    [title] => GTIN
                    [name] => Global Trade Item Number
                    [length] => 14
                    [content] => 95012345678903
                    [raw_content] => 95012345678903
                )

            [422] => Array
                (
                    [code] => 422
                    [title] => ORIGIN
                    [name] => Country of origin of a trade item
                    [length] => 3
                    [content] => 616
                    [raw_content] => 616
                )

            [310] => Array
                (
                    [code] => 310
                    [title] => NET WEIGHT (kg)
                    [name] => Net weight, kilograms
                    [length] => 6
                    [content] => 0.123
                    [raw_content] => 000123
                    [decimals] => 3
                )

        )

)

```

List of implemented identifiers
-------------------------------

[](#list-of-implemented-identifiers)

IdentifierTitleDescription00SSCC[Serial Shipping Container Code](https://www.gs1.org/standards/barcodes/application-identifiers/00?lang=en)01GTIN[Global Trade Item Number (GTIN)](https://www.gs1.org/standards/barcodes/application-identifiers/01?lang=en)02CONTENT[GTIN of contained trade items](https://www.gs1.org/standards/barcodes/application-identifiers/02?lang=en)10BATCH/LOT[Batch or lot number](https://www.gs1.org/standards/barcodes/application-identifiers/10?lang=en)11PROD DATE[Production date](https://www.gs1.org/standards/barcodes/application-identifiers/11?lang=en)12DUE DATE[Due date](https://www.gs1.org/standards/barcodes/application-identifiers/12?lang=en)13PACK DATE[Packaging date](https://www.gs1.org/standards/barcodes/application-identifiers/13?lang=en)15BEST BEFORE[Best before date](https://www.gs1.org/standards/barcodes/application-identifiers/15?lang=en)16SELL BY[Sell by date](https://www.gs1.org/standards/barcodes/application-identifiers/16?lang=en)17USE BY[Expiration date](https://www.gs1.org/standards/barcodes/application-identifiers/17?lang=en)20VARIANT[Internal product variant](https://www.gs1.org/standards/barcodes/application-identifiers/20?lang=en)21SERIAL[Serial number](https://www.gs1.org/standards/barcodes/application-identifiers/21?lang=en)91INTERNAL[Company internal information](https://www.gs1.org/standards/barcodes/application-identifiers/91?lang=en)422ORIGIN[Country of origin of a trade item](https://www.gs1.org/standards/barcodes/application-identifiers/422?lang=en)3100-3105NET WEIGHT (kg)[Net weight, kilograms](https://www.gs1.org/standards/barcodes/application-identifiers/3100?lang=en)3920-3929PRICE[Applicable amount payable, single monetary area (variable measure trade item)](https://www.gs1.org/standards/barcodes/application-identifiers/3920?lang=en)8005PRICE PER UNIT[Price per unit of measure](https://www.gs1.org/standards/barcodes/application-identifiers/8005?lang=en)8008PROD TIME[Date and time of production](https://www.gs1.org/standards/barcodes/application-identifiers/8008?lang=en)The list of all GS1 Application Identifiers can be found [here](https://www.gs1.org/standards/barcodes/application-identifiers)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Total

5

Last Release

1973d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/95dd08b3f7f83eedb53d6a13b37a9c2121336d1ae1615e79d5b274e59d32ead8?d=identicon)[Dartui](/maintainers/Dartui)

---

Top Contributors

[![Dartui](https://avatars.githubusercontent.com/u/2657856?v=4)](https://github.com/Dartui "Dartui (11 commits)")[![LauLaman](https://avatars.githubusercontent.com/u/8283992?v=4)](https://github.com/LauLaman "LauLaman (2 commits)")

---

Tags

data-matrixean128gs1gs1-128gs1-decodergs1-matrixphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nextgen-tech-gs1-decoder/health.svg)

```
[![Health](https://phpackages.com/badges/nextgen-tech-gs1-decoder/health.svg)](https://phpackages.com/packages/nextgen-tech-gs1-decoder)
```

###  Alternatives

[cloudstek/php-laff

Largest Area Fit First (LAFF) 3D box packing algorithm class for PHP

8774.9k](/packages/cloudstek-php-laff)[kpolicar/nova-date-range

Custom date range picker field for Laravel Nova

26176.8k2](/packages/kpolicar-nova-date-range)[tanmuhittin/nova-collapsible-groups

Makes nova core theme navigation collapsible

23179.0k](/packages/tanmuhittin-nova-collapsible-groups)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
