EQRCode v0.1.1 EQRCode View Source

Simple QR Code Generator written in Elixir with no other dependencies.

To generate the SVG QR code:

qr_code_content = "your_qr_code_content"

qr_code_content
|> EQRCode.encode()
|> EQRCode.svg()

Link to this section Summary

Functions

Encode the binary

Encode the binary with custom pattern bits. Only supports version 5

qr_code_content
|> EQRCode.encode()
|> EQRCode.svg(%{color: "#cc6600", shape: "circle", width: 300})

Link to this section Functions

Link to this function encode(bin) View Source
encode(binary()) :: EQRCode.Matrix.t()

Encode the binary.

Link to this function encode(bin, bits) View Source
encode(binary(), bitstring()) :: EQRCode.Matrix.t()

Encode the binary with custom pattern bits. Only supports version 5.

Link to this function svg(matrix, options \\ %{}) View Source
qr_code_content
|> EQRCode.encode()
|> EQRCode.svg(%{color: "#cc6600", shape: "circle", width: 300})

You can specify the following attributes of the QR code:

  • color: In hexadecimal format. The default is #000
  • shape: Only square or circle. The default is square
  • width: The width of the QR code in pixel. Without the width attribute, the QR code size will be dynamically generated based on the input string.

Default options are %{color: "#000", shape: "square"}.