encode

fun encode(input: String, priorityCharset: KiteCharset?, fnc1: Int, shape: SymbolShapeHint, macroId: Int): ByteArray

Encodes input minimally and returns an array of the codewords

Return

An array of bytes representing the codewords of a minimal encoding.

Parameters

input

The string to encode

priorityCharset

The preferred KiteCharset. When the value of the argument is null, the algorithm chooses charsets that leads to a minimal representation. Otherwise the algorithm will use the priority charset to encode any character in the input that can be encoded by it if the charset is among the supported charsets.

fnc1

denotes the character in the input that represents the FNC1 character or -1 if this is not a GS1 bar code. If the value is not -1 then a FNC1 is also prepended.

shape

requested shape.

macroId

Prepends the specified macro function in case that a value of 5 or 6 is specified.