lamoda/gs1-barcode-parser
最新稳定版本:1.1.0
Composer 安装命令:
composer require lamoda/gs1-barcode-parser
包简介
GS1 Barcode parser and validator compatible with official GS1 documentation
README 文档
README
Installation
Composer
composer require lamoda/gs1-barcode-parser
Description
This library provides parsing of GS1 Barcodes according to GS1 General specification and GS1 DataMatrix Guideline.
Library also provides general purpose validator for barcode's content.
Usage
Parser
<?php $config = new \Lamoda\GS1Parser\Parser\ParserConfig(); $parser = new \Lamoda\GS1Parser\Parser\Parser($config); $value = ']d201034531200000111719112510ABCD1234'; $barcode = $parser->parse($value); // $barcode is an object of Barcode class
Validator
<?php $parserConfig = new \Lamoda\GS1Parser\Parser\ParserConfig(); $parser = new \Lamoda\GS1Parser\Parser\Parser($parserConfig); $validatorConfig = new \Lamoda\GS1Parser\Validator\ValidatorConfig(); $validator = new \Lamoda\GS1Parser\Validator\Validator($parser, $validatorConfig); $value = ']d201034531200000111719112510ABCD1234'; $resolution = $validator->validate($value); if ($resolution->isValid()) { // ... } else { var_dump($resolution->getErrors()); }
统计信息
- 总下载量: 73.63k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-21