glqr
gleam add glqr@1
Display QR Code
import gleam/io
import glqr as qr
pub fn main() -> Nil {
let assert Ok(code) =
qr.new("HELLO WORLD")
|> qr.generate()
code
|> qr.to_printable()
|> io.println()
}
Config Options
import gleam/io
import glqr as qr
pub fn main() -> Nil {
let assert Ok(code) =
qr.new("HELLO WORLD")
|> qr.error_correction(qr.L)
|> qr.min_version(10)
|> qr.generate()
code
|> qr.to_printable()
|> io.println()
}
Save SVG
import glqr as qr
import simplifile
pub fn main() -> Nil {
let assert Ok(code) =
qr.new("HELLO WORLD")
|> qr.generate()
let svg =
code
|> qr.to_svg()
let assert Ok(_) = simplifile.write("output.svg", svg)
Nil
}
Further documentation can be found at https://hexdocs.pm/glqr.
Development
gleam run # Run the project
gleam test # Run the tests
TODO
- Import as local module
-
Data Analysis
- Numeric
- Alphanumeric
- Byte
- Kanji
-
Data Encoding
- Mode Indicator
- Character Count Indicator
- Data Bits
- Terminator
- Pad Bits
- Error correction
- QR Code Structure
- Draw Matrix
- Add Snapshot Testing