tdt

package
v0.0.0-...-451c034 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2019 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package tdt contains Tag Data Translation module from binary to Pure Identity

Package tdt contains Tag Data Translation module from binary to Pure Identity

Package tdt contains Tag Data Translation module from binary to Pure Identity

Package tdt contains Tag Data Translation module from binary to Pure Identity

Package tdt contains Tag Data Translation module from binary to Pure Identity

Index

Constants

This section is empty.

Variables

View Source
var AFIAssignment = map[string]string{
	"7B": "1.0.17363:",
	"A1": "1.0.17367:",
	"A2": "1.0.17365:",
	"A3": "1.0.17364:",
	"A4": "1.0.17367:",
	"A5": "1.0.17366:",
	"A6": "1.0.17366:",
	"A7": "1.0.17365:",
	"A8": "1.0.17364:",
	"A9": "1.0.17363:",
	"AA": "1.0.17363:",
}

AFIAssignment is a table for AFI OID arch mapping

View Source
var DIMapping = map[string]string{
	"J":  "1.0.15961.13.4:",
	"1J": "1.0.15961.13.36:",
	"2J": "1.0.15961.13.156:",
	"3J": "1.0.15961.13.157:",
	"4J": "1.0.15961.13.159:",
	"5J": "1.0.15961.13.37:",
	"6J": "1.0.15961.13.38:",
}

DIMapping contains a map for DI to OID arc

View Source
var GIAI96PartitionTable = PartitionTable{
	12: {PValue: 0, CPBits: 40, IARBits: 42, IARDigits: 13},
	11: {PValue: 1, CPBits: 37, IARBits: 45, IARDigits: 14},
	10: {PValue: 2, CPBits: 34, IARBits: 48, IARDigits: 15},
	9:  {PValue: 3, CPBits: 30, IARBits: 52, IARDigits: 16},
	8:  {PValue: 4, CPBits: 27, IARBits: 55, IARDigits: 17},
	7:  {PValue: 5, CPBits: 24, IARBits: 58, IARDigits: 18},
	6:  {PValue: 6, CPBits: 20, IARBits: 62, IARDigits: 19},
}

GIAI96PartitionTable is PT for GIAI

View Source
var GRAI96PartitionTable = PartitionTable{
	12: {PValue: 0, CPBits: 40, ATBits: 4, ATDigits: 0},
	11: {PValue: 1, CPBits: 37, ATBits: 7, ATDigits: 1},
	10: {PValue: 2, CPBits: 34, ATBits: 10, ATDigits: 2},
	9:  {PValue: 3, CPBits: 30, ATBits: 14, ATDigits: 3},
	8:  {PValue: 4, CPBits: 27, ATBits: 17, ATDigits: 4},
	7:  {PValue: 5, CPBits: 24, ATBits: 20, ATDigits: 5},
	6:  {PValue: 6, CPBits: 20, ATBits: 24, ATDigits: 6},
}

GRAI96PartitionTable is PT for GRAI

View Source
var SGTIN96PartitionTable = PartitionTable{
	12: {PValue: 0, CPBits: 40, IRBits: 4, IRDigits: 1},
	11: {PValue: 1, CPBits: 37, IRBits: 7, IRDigits: 2},
	10: {PValue: 2, CPBits: 34, IRBits: 10, IRDigits: 3},
	9:  {PValue: 3, CPBits: 30, IRBits: 14, IRDigits: 4},
	8:  {PValue: 4, CPBits: 27, IRBits: 17, IRDigits: 5},
	7:  {PValue: 5, CPBits: 24, IRBits: 20, IRDigits: 6},
	6:  {PValue: 6, CPBits: 20, IRBits: 24, IRDigits: 7},
}

SGTIN96PartitionTable is PT for SGTIN

View Source
var SSCC96PartitionTable = PartitionTable{
	12: {PValue: 0, CPBits: 40, EBits: 18, EDigits: 5},
	11: {PValue: 1, CPBits: 37, EBits: 21, EDigits: 6},
	10: {PValue: 2, CPBits: 34, EBits: 24, EDigits: 7},
	9:  {PValue: 3, CPBits: 30, EBits: 28, EDigits: 8},
	8:  {PValue: 4, CPBits: 27, EBits: 31, EDigits: 9},
	7:  {PValue: 5, CPBits: 24, EBits: 34, EDigits: 10},
	6:  {PValue: 6, CPBits: 20, EBits: 38, EDigits: 11},
}

SSCC96PartitionTable is PT for SSCC

Functions

func MakePrefixFilterString

func MakePrefixFilterString(patternType string, fields []string) (string, error)

MakePrefixFilterString takes a pattern type and a slice of fields return a binary reporesentation of the prefix filter in string

func NewPrefixFilterGIAI96

func NewPrefixFilterGIAI96(fields []string) (string, error)

NewPrefixFilterGIAI96 takes field values in a slice and return a prefix filter string

func NewPrefixFilterGRAI96

func NewPrefixFilterGRAI96(fields []string) (string, error)

NewPrefixFilterGRAI96 takes field values in a slice and return a prefix filter string

func NewPrefixFilterISO17363

func NewPrefixFilterISO17363(fields []string) (string, error)

NewPrefixFilterISO17363 takes fields and return the prefix filter in string

func NewPrefixFilterISO17365

func NewPrefixFilterISO17365(fields []string) (string, error)

NewPrefixFilterISO17365 takes fields and return the prefix filter in string

func NewPrefixFilterSGTIN96

func NewPrefixFilterSGTIN96(fields []string) (string, error)

NewPrefixFilterSGTIN96 takes field values in a slice and return a prefix filter string

func NewPrefixFilterSSCC96

func NewPrefixFilterSSCC96(fields []string) (string, error)

NewPrefixFilterSSCC96 takes field values in a slice and return a prefix filter string

Types

type Core

type Core struct {
	// contains filtered or unexported fields
}

Core is the TDT core

func NewCore

func NewCore() *Core

NewCore returns a new instance of TDT core

func (*Core) LoadEPCTagDataTranslation

func (c *Core) LoadEPCTagDataTranslation()

LoadEPCTagDataTranslation loads EPC scheme from scheme files

func (*Core) Translate

func (c *Core) Translate(pc []byte, id []byte) (string, error)

Translate takes ID in binary ([]byte) and returns the corresponding PureIdentity

type PartitionTable

type PartitionTable map[int]map[PartitionTableKey]int

PartitionTable is used to get the related values for each coding scheme

type PartitionTableKey

type PartitionTableKey int

PartitionTableKey is used for PartitionTables

const (
	PValue PartitionTableKey = iota
	CPBits
	IRBits
	IRDigits
	EBits
	EDigits
	ATBits
	ATDigits
	IARBits
	IARDigits
)

Key values for PartitionTables

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL