go-barcode

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0

README

barcode

CI CodeQL Coverage Mutation Documentation Go Reference Release Go License

barcode is a standards-driven Go library for validating, encoding, rendering, and decoding common one-dimensional and two-dimensional barcodes. Its core values are immutable logical modules; PNG, SVG, and image.Image output are derived views rather than the source of truth.

symbol, err := qr.Encode([]byte("https://example.invalid/parcel/42"), qr.Options{
    ErrorCorrection: qr.Quartile,
})
if err != nil {
    return err
}
return render.PNG(output, symbol.Logical(), render.Options{Scale: 4})

Import paths use github.com/faustbrian/go-barcode. The image decoder is an additive package; encoders and logical rendering do not require callers to use image detection.

Capability status

No format is marked advertised until its software encoding, decoding, validation, metadata, and independent interoperability evidence are complete. Call barcode.Formats() and barcode.CapabilityFor(format) for the same machine-readable status. Hardware APIs, device control, and physical device certification are outside this library's scope.

Format Encode Image decode GS1 Advertised Current software limitation
QR Code yes yes yes yes none
Code 128 / GS1-128 yes yes yes yes none
Code 39 / Code 93 yes yes no yes none
EAN-8 / EAN-13 yes yes yes yes none
UPC-A / UPC-E yes yes yes yes none
ITF / ITF-14 yes yes ITF-14 yes none
Codabar yes yes no yes optional checksum profiles unavailable
Data Matrix ECC 200 yes yes yes no structured-append sequence assembly incomplete
PDF417 yes yes no no macro sequence assembly incomplete
Aztec yes yes yes yes none

Documentation

Run make check for every blocking local gate. Coverage below meaningful 100%, missing conformance evidence, or an unsupported advertised control remains a release blocker.

Ecosystem

Use the Golib documentation portal to choose companion packages, supported stacks, recipes, and operations guidance.

Directories

Path Synopsis
Package aztec encodes ISO/IEC 24778:2008 logical Aztec Code symbols.
Package aztec encodes ISO/IEC 24778:2008 logical Aztec Code symbols.
Package barcode defines format-neutral barcode symbols and metadata.
Package barcode defines format-neutral barcode symbols and metadata.
Package codabar encodes AIM Codabar logical symbols.
Package codabar encodes AIM Codabar logical symbols.
Package code128 encodes ISO/IEC 15417 Code 128 and GS1-128 symbols.
Package code128 encodes ISO/IEC 15417 Code 128 and GS1-128 symbols.
Package code39 encodes ISO/IEC 16388 Code 39 logical symbols.
Package code39 encodes ISO/IEC 16388 Code 39 logical symbols.
Package code93 encodes ANSI/AIM BC5 Code 93 logical symbols.
Package code93 encodes ANSI/AIM BC5 Code 93 logical symbols.
Package datamatrix encodes ISO/IEC 16022:2024 ECC 200 logical symbols.
Package datamatrix encodes ISO/IEC 16022:2024 ECC 200 logical symbols.
Package ean encodes ISO/IEC 15420 EAN-8 and EAN-13 logical symbols.
Package ean encodes ISO/IEC 15420 EAN-8 and EAN-13 logical symbols.
Package gs1 validates GS1 identifiers and element strings.
Package gs1 validates GS1 identifiers and element strings.
Package imagedecode provides additive, bounded image barcode decoding.
Package imagedecode provides additive, bounded image barcode decoding.
internal
aztecencoder
Package encoder implements Aztec encoding with GS1 and ECI controls.
Package encoder implements Aztec encoding with GS1 and ECI controls.
linear
Package linear adapts logical one-dimensional ZXing encoders.
Package linear adapts logical one-dimensional ZXing encoders.
pdf417encoder
Package pdf417encoder implements ISO/IEC 15438 PDF417 encoding.
Package pdf417encoder implements ISO/IEC 15438 PDF417 encoding.
Package itf encodes ISO/IEC 16390 Interleaved 2 of 5 and GS1 ITF-14.
Package itf encodes ISO/IEC 16390 Interleaved 2 of 5 and GS1 ITF-14.
Package pdf417 encodes ISO/IEC 15438:2015 PDF417 logical symbols.
Package pdf417 encodes ISO/IEC 15438:2015 PDF417 logical symbols.
Package qr encodes ISO/IEC 18004:2024 QR Code logical symbols.
Package qr encodes ISO/IEC 18004:2024 QR Code logical symbols.
Package render converts immutable logical symbols to raster and SVG output.
Package render converts immutable logical symbols to raster and SVG output.
Package specification exposes pinned, redistributable standards artifacts.
Package specification exposes pinned, redistributable standards artifacts.
Package upc encodes ISO/IEC 15420 UPC-A and UPC-E logical symbols.
Package upc encodes ISO/IEC 15420 UPC-A and UPC-E logical symbols.

Jump to

Keyboard shortcuts

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