{"id":24564693,"url":"https://github.com/sergiss/epc-tds","last_synced_at":"2025-04-19T20:38:17.825Z","repository":{"id":37531265,"uuid":"402169920","full_name":"sergiss/epc-tds","owner":"sergiss","description":":factory: EPC Tag Data Standard encoding and decoding library, written in typescript/javascript for Node.js","archived":false,"fork":false,"pushed_at":"2024-07-06T14:49:20.000Z","size":2435,"stargazers_count":32,"open_issues_count":0,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-07T13:04:07.671Z","etag":null,"topics":["decoding","encoding","epc","gdti","gia","gid","gpi","grai","gs1","gsrn","library","node-js","rfid","sgcn","sgln","sgtin","sscc","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sergiss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-01T18:51:03.000Z","updated_at":"2025-02-19T17:16:54.000Z","dependencies_parsed_at":"2024-10-14T01:15:51.208Z","dependency_job_id":null,"html_url":"https://github.com/sergiss/epc-tds","commit_stats":{"total_commits":79,"total_committers":1,"mean_commits":79.0,"dds":0.0,"last_synced_commit":"82758ccca158a8069457a3813295fd68fe5fa832"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiss%2Fepc-tds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiss%2Fepc-tds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiss%2Fepc-tds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiss%2Fepc-tds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergiss","download_url":"https://codeload.github.com/sergiss/epc-tds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249467962,"owners_count":21277518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decoding","encoding","epc","gdti","gia","gid","gpi","grai","gs1","gsrn","library","node-js","rfid","sgcn","sgln","sgtin","sscc","typescript"],"created_at":"2025-01-23T11:20:18.254Z","updated_at":"2025-04-19T20:38:17.803Z","avatar_url":"https://github.com/sergiss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# epc-tds\n\nEPC Tag Data Standard encoding and decoding library, offering full compatibility across JavaScript and TypeScript environments, including both Node.js and frontend applications.\n\nSimple, very fast and easy to use ;)\n\n[![NPM Version][npm-version-image]][npm-url]\n\n## Usage\n\n### Automatic decoding of any standard (SGTIN-96, SGTIN-198, SSCC-96, SGLN-96, GID, GRAI, GSRN, ...)\n```js\n\nconst epcTds = require('epc-tds');\n\nvar epc = epcTds.valueOf(\"3074257BF7194E4000001A85\"); // SGTIN-96\nconsole.log(\"Id URI : \" + epc.toIdURI());\nconsole.log(\"Tag URI: \" + epc.toTagURI());\nconsole.log(\"Barcode: \" + epc.toBarcode()); // sgtin\nconsole.log(\"Serial : \" + epc.getSerial());\n\nepc = epcTds.valueOf(\"3178E61C883950F59A000000\"); // SSCC-96\nconsole.log(\"Id URI : \" + epc.toIdURI());\nconsole.log(\"Tag URI: \" + epc.toTagURI());\nconsole.log(\"Barcode: \" + epc.toBarcode()); // sscc\nconsole.log(\"Serial : \" + epc.getSerialReference());\n\nepc = epcTds.valueOf(\"377A6BB0C1BDA6D9B664D1AB266D1AB266D1AB266D00\"); // GRAI-170\nconsole.log(\"Id URI : \" + epc.toIdURI());\nconsole.log(\"Tag URI: \" + epc.toTagURI());\nconsole.log(\"Barcode: \" + epc.toBarcode()); // grai\nconsole.log(\"Serial : \" + epc.getSerial());\n\n```\n\n### Decode Hex EPC\n```js\n\nconst epcTds = require('epc-tds');\n\n// Decode from Hex EPC\nlet epc = tds.valueOf(\"3074257BF7194E4000001A85\"); // sgtin-96\n\n// Acces to epc properties\nconsole.log(\"Type: \"          + epc.getType()); // TDS ID\nconsole.log(\"Filter: \"        + epc.getFilter()); // filter index\nconsole.log(\"Partition: \"     + epc.getPartition()); // partition index\nconsole.log(\"CompanyPrefix: \" + epc.getCompanyPrefix());\nconsole.log(\"ItemReference: \" + epc.getItemReference());\nconsole.log(\"GTIN(EAN): \"     + epc.getGtin()); // ean\nconsole.log(\"HexEPC: \"        + epc.toHexString()); // HEX EPC\nconsole.log(\"Tag URI: \"       + epc.toTagURI());\n\n// Decode from Hex Tag URI\nepc = epcTds.fromTagURI('urn:epc:tag:sgtin-96:3.0614141.812345.6789');\nconsole.log(\"HexEPC: \"  + epc.toHexString()); // HEX EPC\nconsole.log(\"Tag URI: \" + epc.toTagURI());\n\n```\n\n### Encode Hex EPC\n```js\n\nconst epcTds = require('epc-tds');\n\n// e.g. 1: EAN + Serial\nlet epc1 = new epcTds.Sgtin96().setFilter(3)\n                            .setPartition(5)\n                            .setGtin(\"00001234523457\")\n                            .setSerial(1823342345);\n\nconsole.log(\"HexEPC: \"  + epc1.toHexString()); // HEX EPC\nconsole.log(\"Tag URI: \" + epc1.toTagURI());\n       \n// e.g. 2: (companyPrefix + ItemReference) + Serial\nlet epc2 = new epcTds.Sgtin96().setFilter(3)\n                            .setPartition(5)\n                            .setCompanyPrefix(78952)\n                            .setItemReference(44235)\n                            .setSerial(1010011010);\n                        \nconsole.log(\"HexEPC: \"  + epc2.toHexString()); // HEX EPC\nconsole.log(\"Tag URI: \" + epc2.toTagURI());\n\n```\n\n\u003cNote\u003e\n\n**Note:** This is a summary of how the library works, check the source code for more features.\n\n\u003c/Note\u003e\n\n### Frontend version\n\n```\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n    \u003chead\u003e\n        \u003cscript src=\"/bundle/epc-tds.min.js\"\u003e\u003c/script\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003cscript\u003e\n            const tds = require('epc-tds')\n            let epc = tds.valueOf(\"3074257BF7194E4000001A85\");\n            alert(epc.toTagURI());\n        \u003c/script\u003e \n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n[www.sergiosoriano.com](https://www.sergiosoriano.com)\n\n[npm-url]: https://npmjs.org/package/epc-tds\n[npm-version-image]: https://img.shields.io/npm/v/epc-tds","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiss%2Fepc-tds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergiss%2Fepc-tds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiss%2Fepc-tds/lists"}