qrcodes

package
v1.94.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

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