npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mimasu/tdt

v3.0.7

Published

GS1 EPC Tag Data Translation for JavaScript/TypeScript and RAIN (UHF) RFID via WebAssembly. Encode and decode SGTIN, SSCC, SGLN, GRAI, and all EPC schemes.

Downloads

509

Readme

@mimasu/tdt

Encode and decode GS1 EPC identifiers for RAIN (UHF) RFID in JavaScript and TypeScript. Convert between GTIN, SSCC, SGLN, and 50+ other formats — from barcode to EPC hex and back.

Powered by WebAssembly. No native dependencies. Works in Node.js and browsers.

Implements the GS1 EPC Tag Data Standard (TDS) 2.3 and Tag Data Translation (TDT) 2.2 specifications.

Try it online: https://www.mimasu.nl/tag-data-translation/try-online

Installation

npm install @mimasu/tdt

Quick Start

Encode a GTIN to EPC Hex

import { createEngine } from "@mimasu/tdt";

const engine = await createEngine();

// encode GTIN + serial to SGTIN-96 binary
const epc = engine.translate(
  "gtin=00037000302414;serial=10419703",
  "filter=3;gs1companyprefixlength=7;tagLength=96",
  "BINARY"
);
const hex = engine.binaryToHex(epc);
console.log(hex);
// 30340242201d8840009efdf7

Decode EPC Hex to GTIN

const binary = engine.hexToBinary("30340242201d8840009efdf7");
const uri = engine.translate(binary, "", "PURE_IDENTITY");
console.log(uri);
// urn:epc:id:sgtin:0037000.030241.10419703

CommonJS

const { createEngine } = require("@mimasu/tdt");

async function main() {
  const engine = await createEngine();
  // ...
}
main();

Use Cases

  • Tag programming: Encode GTINs and SSCCs to EPC hex for writing to RFID tags
  • Tag reading: Decode EPC hex from RFID readers back to human-readable identifiers
  • Inventory systems: Translate between barcode and RFID representations
  • Supply chain apps: Convert between GS1 Digital Link URIs and EPC binary

API

createEngine(): Promise<TDTEngine>

Initialize the WASM engine. Call once, reuse the engine instance for all translations.

engine.translate(epcIdentifier, parameterList, outputFormat): string

Translate an EPC between encoding levels. Output formats: BINARY, LEGACY, LEGACY_AI, TAG_ENCODING, PURE_IDENTITY.

Throws on invalid input.

engine.tryTranslate(epcIdentifier, parameterList, outputFormat): string | null

Same as translate, but returns null instead of throwing. Use this for high-throughput scenarios.

engine.hexToBinary(hex): string

Convert hexadecimal string to binary string.

engine.binaryToHex(binary): string

Convert binary string to hexadecimal string.

Supported Schemes

SGTIN-96, SGTIN-198, SSCC-96, SGLN-96, SGLN-195, GRAI-96, GRAI-170, GIAI-96, GIAI-202, GSRN-96, GSRNP-96, GDTI-96, GDTI-113, GDTI-174, SGCN-96, ITIP-110, ITIP-212, GID-96, CPI-96, CPI-var, ADI-var, USDOD-96, plus all TDS 2.3 '+' and '++' variants with Digital Link URI support.

Performance

The underlying .NET engine runs as compiled WebAssembly — no interpretation overhead.

| Operation | Time | |-----------|------| | SGTIN-96 encode | 7.8 us | | SGTIN-96 decode | 7.7 us | | HexToBinary (96-bit) | 99 ns | | BinaryToHex (96-bit) | 54 ns |

License

Business Source License 1.1 (BSL-1.1). Non-production use (development, testing, evaluation) is free. Production use requires a commercial license — contact [email protected].

See LICENSING.md for full details.