qrcode

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0 modules, 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 qrcode draws QR codes for the setup of the two-step check (docs/design/host-totp.md): on a terminal, and as a module matrix that a page paints itself. The encoding is rsc.io/qr's (BSD 3-clause, pure Go).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableColors

func EnableColors(*os.File)

EnableColors makes the console behind f understand the colour sequences Terminal uses; terminals on this system already do.

func Rows

func Rows(text string) ([]string, error)

Rows encodes text at error correction level L and returns the modules as rows of '1' (dark) and '0' (light), without the quiet zone. L (7 %) is enough for a code shown on a screen, which nothing smudges, and keeps the code small: 41 modules for a setup URI where M needs 45.

func Terminal

func Terminal(text string) (string, error)

Terminal draws text's QR code for a terminal, two modules per character cell with half blocks. Colours are set explicitly, black on bright white (plain white is grey in many terminal themes), so the code reads the right way round, with enough contrast, on dark and light terminals.

Types

This section is empty.

Jump to

Keyboard shortcuts

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