View Source QRNBUGenerator (NBU payment QR v0.3.3)

Generator module for NBU QR code data strings.

This module generates the formatted data strings according to NBU specifications. It does NOT render QR code images - use a separate QR rendering library for that.

Summary

Functions

Generate QR data string from raw data.

Functions

Link to this function

generate(data, opts \\ [])

View Source
@spec generate(
  binary(),
  keyword()
) :: {:ok, binary()} | {:error, binary()}

Generate QR data string from raw data.

Parameters

  • data - The formatted data string
  • opts - Options (reserved for future use)

Returns

  • {:ok, data_string} - The data string ready for QR encoding
  • {:error, reason} - Error message

Example

iex> data = "BCD\n002\n1\nUCT\n...\n"
iex> QRNBUGenerator.generate(data)
{:ok, "BCD\n002\n1\nUCT\n...\n"}