MCPcopy Index your code
hub / github.com/boombuler/barcode

github.com/boombuler/barcode @v1.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.0 ↗ · + Follow
346 symbols 1,004 edges 66 files 61 documented · 18% 81 cross-repo links updated 11mo agov1.1.0 · 2025-07-22★ 1,5557 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Join the chat at https://gitter.im/golang-barcode/Lobby

Introduction

This is a package for GO which can be used to create different types of barcodes.

Supported Barcode Types

  • 2 of 5
  • Aztec Code
  • Codabar
  • Code 128
  • Code 39
  • Code 93
  • Datamatrix
  • EAN 13
  • EAN 8
  • PDF 417
  • QR Code

Example

This is a simple example on how to create a QR-Code and write it to a png-file

package main

import (
    "image/png"
    "os"

    "github.com/boombuler/barcode"
    "github.com/boombuler/barcode/qr"
)

func main() {
    // Create the barcode
    qrCode, _ := qr.Encode("Hello World", qr.M, qr.Auto)

    // Scale the barcode to 200x200 pixels
    qrCode, _ = barcode.Scale(qrCode, 200, 200)

    // create the output file
    file, _ := os.Create("qrcode.png")
    defer file.Close()

    // encode the barcode as png
    png.Encode(file, qrCode)
}

Documentation

See GoDoc

To create a barcode use the Encode function from one of the subpackages.

Extension points exported contracts — how you extend this code

Barcode (Interface)
a rendered and encoded barcode [6 implementers]
barcode.go
BarcodeColor (Interface)
(no doc) [5 implementers]
barcode.go
BarcodeIntCS (Interface)
Additional interface that some barcodes might implement to provide the value of its checksum. [2 implementers]
barcode.go

Core symbols most depended-on inside this repo

Set
called by 42
datamatrix/codelayout.go
MatrixColumns
called by 40
datamatrix/codesize.go
AddBit
called by 28
utils/bitlist.go
AddBits
called by 28
utils/bitlist.go
MatrixRows
called by 26
datamatrix/codesize.go
set
called by 26
aztec/azteccode.go
GetBit
called by 24
utils/bitlist.go
Len
called by 19
utils/bitlist.go

Shape

Function 181
Method 119
Struct 29
TypeAlias 10
Interface 4
FuncType 3

Languages

Go100%

Modules by API surface

qr/qrcode.go16 symbols
scaledbarcode.go14 symbols
qr/encoder.go14 symbols
utils/base1dcode.go13 symbols
aztec/token.go13 symbols
datamatrix/codelayout.go12 symbols
aztec/state.go12 symbols
utils/bitlist.go11 symbols
datamatrix/datamatrixcode.go11 symbols
utils/gfpoly.go10 symbols
pdf417/highlevel.go10 symbols
aztec/azteccode.go10 symbols

For agents

$ claude mcp add barcode \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact