qrencode is a wrapper of libqrencode with libpng for lua.
qrencode is dependent on libqrencode and libpng, so make sure these are installed before compile it.
qr = require "qrencode"
-- print PNG data stream to stdout.
print(qr.encode("is ok?"))
print(qr:encode("is ok?"))
print(qr("is ok?"))
-- print ansi char
print(qr {text = "is ok?", ansi = true})
-- or pass a table :
print(qr {
text="is ok?",
level="L",
kanji=false,
ansi=true,
size=4,
margin=2,
symversion=0,
dpi=78,
casesensitive=false,
foreground="48AF6D",
background="3FAF6F"
}
)
when pass a table, "text" is required and other is optional.
vinoca http://www.vinoca.org/
Code and documentation copyright 2014-2015 vinoca. Code released under the MIT license. Docs released under Creative commons.