New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

epc-tds

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

epc-tds

EPC Tag Data Standard encoding and decoding library, written in javascript for Node.js

  • 0.6.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

epc-tds

EPC Tag Data Standard encoding and decoding library, written in javascript for Node.js

Simple, very fast and easy to use ;)

Usage

Decode Hex EPC

// Decode from Hex EPC
let epc = Epc.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());

Encode Hex EPC


// e.g. 1: EAN + Serial
let epc1 = new 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 Sgtin96().setFilter(3)
                        .setPartition(5)
                        .setCompanyPrefix(78952)
                        .setItemReference(44235)
                        .setSerial(1010011010);
                        
console.log("HexEPC: "  + epc2.toHexString()); // HEX EPC
console.log("Tag URI: " + epc2.toTagURI());

https://www.sergiosoriano.com

FAQs

Package last updated on 02 Sep 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc