code49

package
v0.0.0-...-784ae19 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FNC1 = -1
	FNC2 = -2
	FNC3 = -3
	FNC4 = -4

	FNC1String = "\\<FNC1>"
	FNC2String = "\\<FNC2>"
	FNC3String = "\\<FNC3>"
	FNC4String = "\\<FNC4>"
)

Variables

This section is empty.

Functions

func Decode

func Decode(patterns []string, skipChecksum bool) string

Decode decodes barcode `patterns` which contains multiple rows with scanned bar/space amounts, start with prefix `11` and end with suffix `4`, returns basic text. The basic text means that text decoded by this method contains checksum mixin characters. It treads the Code49 as Mode-0, ignores other non-data characters. If `skipChecksum` presents to true, Decode will ignore the last line of `patterns`.

func DecodeRaw

func DecodeRaw(patterns []string) string

DecodeRaw decodes barcode `patterns` which contains multiple rows with scanned bar/space amounts, start with prefix `11` and end with suffix `4`, returns raw text. It treads the Code49 as Mode-0, ignores other non-data characters.

func Encode

func Encode(text string) (patterns []string, encodationPatterns [][]int, err error)

Encode encodes a given text into patterns in Code49

func SetMode

func SetMode(m DataType)

SetMode set data type in mode ECI, GS1 or HIBC. The default mode is ECI.

Types

type DataType

type DataType int
const (
	ECI  DataType = 0 // Extended Channel Interpretations (default)
	GS1  DataType = 1 // GS1 Application Identifier and data pairs in "[AI]DATA" format
	HIBC DataType = 2 // Health Industry Bar Code number (without check digit)
)

Jump to

Keyboard shortcuts

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