qrcodes

package
v1.104.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: BSD-3-Clause Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package qrcodes provides functions to render or format QR codes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodePNG

func EncodePNG(s string, size int) ([]byte, error)

EncodePNG renders a QR code for s as a PNG, with a width and height of size pixels.

func Fprintln

func Fprintln(w io.Writer, format Format, s string) (n int, err error)

Fprintln formats s according to Format and writes a QR code to w, along with a newline. It returns the number of bytes written and any write error encountered.

Types

type Format

type Format string

Format selects the text representation used to print QR codes.

const (
	// FormatAuto will format QR codes to best fit the capabilities of the
	// [io.Writer].
	FormatAuto Format = "auto"

	// FormatASCII will format QR codes with only ASCII characters.
	FormatASCII Format = "ascii"

	// FormatLarge will format QR codes with full block characters.
	FormatLarge Format = "large"

	// FormatSmall will format QR codes with full and half block characters.
	FormatSmall Format = "small"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL