Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@ombori/epc-ean
Advanced tools
EPC Tag Data Standard encoding and decoding library, written in javascript
EPC Tag Data Standard encoding and decoding library, written in javascript (Node.JS and Frontend)
Simple, very fast and easy to use ;)
const epcTds = require('epc-tds');
var epc = epcTds.valueOf("3074257BF7194E4000001A85"); // SGTIN-96
console.log("Id URI : " + epc.toIdURI());
console.log("Tag URI: " + epc.toTagURI());
console.log("Barcode: " + epc.toBarcode()); // sgtin
console.log("Serial : " + epc.getSerial());
epc = epcTds.valueOf("3178E61C883950F59A000000"); // SSCC-96
console.log("Id URI : " + epc.toIdURI());
console.log("Tag URI: " + epc.toTagURI());
console.log("Barcode: " + epc.toBarcode()); // sscc
console.log("Serial : " + epc.getSerialReference());
epc = epcTds.valueOf("377A6BB0C1BDA6D9B664D1AB266D1AB266D1AB266D00"); // GRAI-170
console.log("Id URI : " + epc.toIdURI());
console.log("Tag URI: " + epc.toTagURI());
console.log("Barcode: " + epc.toBarcode()); // grai
console.log("Serial : " + epc.getSerial());
const epcTds = require('epc-tds');
// Decode from Hex EPC
let epc = tds.valueOf("3074257BF7194E4000001A85"); // sgtin-96
// Acces to epc properties
console.log("Type: " + epc.getType()); // TDS ID
console.log("Filter: " + epc.getFilter()); // filter index
console.log("Partition: " + epc.getPartition()); // partition index
console.log("CompanyPrefix: " + epc.getCompanyPrefix());
console.log("ItemReference: " + epc.getItemReference());
console.log("GTIN(EAN): " + epc.getGtin()); // ean
console.log("HexEPC: " + epc.toHexString()); // HEX EPC
console.log("Tag URI: " + epc.toTagURI());
// Decode from Hex Tag URI
epc = epcTds.fromTagURI('urn:epc:tag:sgtin-96:3.0614141.812345.6789');
console.log("HexEPC: " + epc.toHexString()); // HEX EPC
console.log("Tag URI: " + epc.toTagURI());
const epcTds = require('epc-tds');
// e.g. 1: EAN + Serial
let epc1 = new epcTds.Sgtin96().setFilter(3)
.setPartition(5)
.setGtin("00001234523457")
.setSerial(1823342345);
console.log("HexEPC: " + epc1.toHexString()); // HEX EPC
console.log("Tag URI: " + epc1.toTagURI());
// e.g. 2: (companyPrefix + ItemReference) + Serial
let epc2 = new epcTds.Sgtin96().setFilter(3)
.setPartition(5)
.setCompanyPrefix(78952)
.setItemReference(44235)
.setSerial(1010011010);
console.log("HexEPC: " + epc2.toHexString()); // HEX EPC
console.log("Tag URI: " + epc2.toTagURI());
Note: This is a summary of how the library works, check the source code for more features.
<!DOCTYPE html>
<html lang="en">
<head>
<script src="/bundle/epc-tds.min.js"></script>
</head>
<body>
<script>
const tds = require('epc-tds')
let epc = tds.valueOf("3074257BF7194E4000001A85");
alert(epc.toTagURI());
</script>
</body>
</html>
FAQs
EPC Tag Data Standard encoding and decoding library, written in javascript
The npm package @ombori/epc-ean receives a total of 386 weekly downloads. As such, @ombori/epc-ean popularity was classified as not popular.
We found that @ombori/epc-ean demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.