Output QR codes for Go
- Output to text
- two characters as a block
- half character as a block
- Output to terminal
- bash
- zsh
- Output to file
- text
- png
- jpeg
As shown in the figure, you can get started quickly with the following example:
Show a QR block by two characters.
BlockWrite(os.Stdout, L, "Hello world!")
BlockWriteFile("file_path", L, "Hello world!")
Show a QR block by half character.
HalfBlockWrite(os.Stdout, L, "Hello world!")
HalfBlockWriteFile("file_path", L, "Hello world!")
Common functions:
func BlockWrite(io.Writer, Level, string) error
func BlockWriteFile(string, Level, string) error
func HalfBlockWrite(io.Writer, Level, string) error
func HalfBlockWriteFile(string, Level, string) error
func Bash(Level, string) error
func PNG(string, Level, string) error
func JPEG(string, Level, string) error
See document.
From least to most tolerant of errors:
L
20% redundantM
38% redundantQ
55% redundantH
65% redundant
The definitions comes from rsc/qr.
go get -u github.com/WindomZ/qrw
- Driven by rsc/qr
- Inspired by mdp/qrterminal