# `SefazDanfe.QrCode`
[🔗](https://github.com/devaction-labs/sefaz_danfe/blob/v0.1.0/lib/sefaz_danfe/qr_code.ex#L1)

A QR Code (ISO/IEC 18004, model 2) encoder for the DANFE NFC-e: byte mode, error correction level
M (the level the NFC-e manual asks for), versions 1 to 14, the best of the eight masks.

`encode/1` answers the symbol as the runs of dark modules of each row, which the layout draws as
rectangles (the quiet zone is the layout's):

    {:ok, %{size: 45, runs: [[row, column, length], ...]}}

A text that does not fit version 14 (362 bytes) is `{:error, :too_long}`.

Everything is a pure function of the text; the tables are those of the standard for level M.

# `symbol`

```elixir
@type symbol() :: %{size: pos_integer(), runs: [[non_neg_integer()]]}
```

# `encode`

```elixir
@spec encode(String.t()) :: {:ok, symbol()} | {:error, :too_long}
```

The QR Code of `text`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
