huweiqing915 / qrencode

qrencode for lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

qrencode: qrencode is a wrapper of libqrencode with libpng for lua.

qrencode is a wrapper of libqrencode with libpng for lua.

Install

qrencode is dependent on libqrencode and libpng, so make sure these are installed before compile it.

Example usage

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.

Author

vinoca http://www.vinoca.org/

Copyright and license

Code and documentation copyright 2014-2015 vinoca. Code released under the MIT license. Docs released under Creative commons.

About

qrencode for lua

License:Other


Languages

Language:C 94.6%Language:Lua 3.2%Language:Makefile 2.2%