Documentation
¶
Overview ¶
Package qrcode implements a deterministic, self-contained pure-Go ISO/IEC 18004 QR Code Model 2 encoder (versions 1–10, byte mode, error correction levels L/M/Q/H). It has zero external dependencies and compiles across desktop, mobile, and web targets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyInput = errors.New("qrcode: input must not be empty")
ErrEmptyInput is returned when Encode receives an empty payload.
var ErrPayloadTooLarge = errors.New("qrcode: input exceeds maximum capacity")
ErrPayloadTooLarge is returned when the input exceeds version 10 capacity for the chosen level.
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code struct {
// Version is the ISO/IEC 18004 symbol version (1..10).
Version int
// Level is the error correction level used to encode the symbol.
Level Level
// Mask is the chosen data mask pattern (0..7).
Mask int
// Size is the module width and height (4*Version + 17).
Size int
// contains filtered or unexported fields
}
Code holds a finished QR Code symbol matrix.
func Encode ¶
Encode encodes text as a deterministic ISO/IEC 18004 QR Code Model 2 symbol in byte mode at the smallest version (1..10) that fits text at error correction level.
func (*Code) Black ¶
Black reports whether the module at column x, row y is dark. Coordinates outside [0, Size) return false (light quiet zone).