QRCode - a library for generating QR code

Hi folks!

We’ve just finished (me and @smita) our new QRCode library for Elixir. Now you can generate QR code whenever you’ll want… :tada:

Basic usage looks like:

iex> qr = QRCode.create("Hello World")
iex> qr |> Result.and_then(&QRCode.Svg.save_as(&1,"/path/to/hello.svg"))
{:ok, "/path/to/hello.svg"}

If you want to change, for example, ecc level and the color of QR code you can write

iex> settings = %QRCode.SvgSettings{qrcode_color: {17, 170, 136}}
iex> qr = QRCode.create("quiz_string", :high)
iex> qr |> Result.and_then(&QRCode.Svg.save_as(&1, "/path/to/quiz.svg", settings))
{:ok, "/path/to/quiz.svg"}

qrcode_color

Let’s try to decode the QR code above by your QR reader. You can find the result below…

Notes

  • this library was developed only for Byte mode
  • as side project was developed MatrixReloaded library for manipulating with matrices and vectors

Comments, what improve, what make better,… are welcome.

Happy QR coding.

quiz_string =

Find what you love and let it kill you.
Charles Bukowski

11 Likes