Documentation ¶
Index ¶
Constants ¶
const BYTE_SWITCH_CODE_WORD = 901
Code word used to switch to Text mode.
const BYTE_SWITCH_CODE_WORD_ALT = 924
Alternate code word used to switch to Text mode; used when number of Texts to encode is divisible by 6.
const DEFAULT_COLUMNS = 6
const DEFAULT_SECURITY_LEVEL = 2
const MAX_CODE_WORDS = 925
const MAX_COLUMNS = 30
const MAX_ROWS = 90
const MAX_SECURITY_LEVEL = 8
const MIN_COLUMNS = 1
const MIN_ROWS = 3
const MIN_SECURITY_LEVEL = 0
const NUMBER_SWITCH_CODE_WORD int = 902
const PADDING_CODE_WORD = 900
const PADDING_VALUE = 29
Since each code word consists of 2 characters, a padding value is needed when encoding a single character. 29 is used as padding because it's a switch in all 4 submodes, and doesn't add any data.
const START_CHARACTER = 0x1fea8
const STOP_CHARACTER = 0x3fa29
const SUBMODE_LOWER = "SUBMODE_LOWER"
Lowercase submode.
const SUBMODE_MIXED = "SUBMODE_MIXED"
mixed submode (numbers and some punctuation).
const SUBMODE_PUNCT = "SUBMODE_PUNCT"
Punctuation submode.
const SUBMODE_UPPER = "SUBMODE_UPPER"
Uppercase submode.
const SWITCH_LOWER = "SWITCH_LOWER"
Switch to lowercase submode.
const SWITCH_MIXED = "SWITCH_MIXED"
Switch to mixed submode.
const SWITCH_PUNCT = "SWITCH_PUNCT"
Switch to punctuation submode.
const SWITCH_PUNCT_SINGLE = "SWITCH_PUNCT_SINGLE"
Switch to punctuation submode for a single character.
const SWITCH_UPPER = "SWITCH_UPPER"
Switch to uppercase submode.
const SWITCH_UPPER_SINGLE = "SWITCH_UPPER_SINGLE"
Switch to uppercase submode for a single character.
const TEXT_SWITCH_CODE_WORD int = 900
Code word used to switch to Text mode.
Variables ¶
This section is empty.
Functions ¶
func ComputeReedSolomon ¶
Types ¶
type Barcode ¶
type Barcode struct { Data string CodeWords []int Columns int Rows int Codes [][]int SecurityLevel int // contains filtered or unexported fields }
func (*Barcode) ColorModel ¶
type ByteEncoder ¶
type ByteEncoder struct { }
func CreateByteEncoder ¶
func CreateByteEncoder() *ByteEncoder
func (ByteEncoder) CanEncode ¶
func (ByteEncoder) CanEncode(char string) bool
func (ByteEncoder) GetSwitchCode ¶
func (ByteEncoder) GetSwitchCode(data string) int
type DataEncoder ¶
func CreateDataEncoder ¶
func CreateDataEncoder() DataEncoder
func (DataEncoder) Encode ¶
func (dataEncoder DataEncoder) Encode(data string) []int
func (DataEncoder) SplitToChains ¶
func (dataEncoder DataEncoder) SplitToChains(data string) []Chain
type NumberEncoder ¶
type NumberEncoder struct { }
func CreateNumberEncoder ¶
func CreateNumberEncoder() *NumberEncoder
func (NumberEncoder) CanEncode ¶
func (encoder NumberEncoder) CanEncode(char string) bool
func (NumberEncoder) Encode ¶
func (encoder NumberEncoder) Encode(digits string, addSwitchCode bool) []int
func (NumberEncoder) GetName ¶
func (encoder NumberEncoder) GetName() string
func (NumberEncoder) GetSwitchCode ¶
func (encoder NumberEncoder) GetSwitchCode(data string) int
type TextEncoder ¶
type TextEncoder struct { CharacterTables map[string][]string Switching map[string]map[string][]string SwitchSubmode map[string]string ReverseLookup map[string]map[string]int }
func CreateTextEncoder ¶
func CreateTextEncoder() *TextEncoder
func (TextEncoder) CanEncode ¶
func (encoder TextEncoder) CanEncode(char string) bool
func (TextEncoder) Encode ¶
func (encoder TextEncoder) Encode(data string, addSwitchCode bool) []int
func (TextEncoder) GetName ¶
func (encoder TextEncoder) GetName() string
func (TextEncoder) GetSwitchCode ¶
func (TextEncoder) GetSwitchCode(data string) int