encode static method

Uint8List encode(
  1. String input,
  2. Encoding? priorityCharset,
  3. int fnc1,
  4. SymbolShapeHint shape,
  5. int macroId,
)

Encodes input minimally and returns an array of the codewords

@param input The string to encode @param priorityCharset The preferred {@link Charset}. 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. @param 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. @param shape requested shape. @param macroId Prepends the specified macro function in case that a value of 5 or 6 is specified. @return An array of bytes representing the codewords of a minimal encoding.

Implementation

static Uint8List encode(
  String input,
  Encoding? priorityCharset,
  int fnc1,
  SymbolShapeHint shape,
  int macroId,
) {
  return encodeMinimally(
    Input(
      input,
      priorityCharset,
      fnc1,
      shape,
      macroId,
    ),
  ).bytes;
}