Documentation
¶
Overview ¶
Package qr is a small QR Code encoder (ISO/IEC 18004, Model 2): byte mode, versions 1-40, error correction levels L/M/Q/H. It exists so the CLI can print a QR code to a terminal without a dependency.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTooLong = errors.New("qr: data too long for a QR code")
ErrTooLong means the data does not fit in a version 40 symbol at the chosen level.
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code struct {
Size int // modules per side, 4*version+17
// contains filtered or unexported fields
}
Code is an encoded symbol, without the quiet zone.
func (*Code) Black ¶
Black reports whether the module at column x, row y is dark. Outside the symbol it is false.
func (*Code) Terminal ¶
Terminal draws the code with Unicode half blocks, two modules per text row, inside the 4-module quiet zone (ISO/IEC 18004 "Quiet zone"). Every row ends with a newline.
By default the light modules are the blocks, which scans on a dark terminal (light text on a dark background). With invert the dark modules are the blocks, for a light terminal.