All Projects → yeqown → go-qrcode

yeqown / go-qrcode

Licence: MIT license
To help gophers generate QR Codes with customized styles, such as color, block size, block shape, and icon.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-qrcode

colorful-qrcode
Simple & colorful QR code generator with chrome extension
Stars: ✭ 13 (-94.92%)
Mutual labels:  qrcode, colorful
qrrs
CLI QR code generator and reader written in rust
Stars: ✭ 29 (-88.67%)
Mutual labels:  qrcode
google-authenticator
Google Authenticator
Stars: ✭ 20 (-92.19%)
Mutual labels:  qrcode
WeChatQRCode
⛄ 基于OpenCV开源的微信二维码引擎移植的Android扫码识别库
Stars: ✭ 250 (-2.34%)
Mutual labels:  qrcode
QRCodeCameraX
QRcode decoder based on CameraX & zxing-core & ML kit, in less than 50 lines
Stars: ✭ 111 (-56.64%)
Mutual labels:  qrcode
QRCodeView
用于简化二维码扫描的框架
Stars: ✭ 34 (-86.72%)
Mutual labels:  qrcode
luaqrcode
Pure Lua qrcode library
Stars: ✭ 114 (-55.47%)
Mutual labels:  qrcode
WaiterBell
WaiterBell - The ticketing system in real world!
Stars: ✭ 16 (-93.75%)
Mutual labels:  qrcode
paper-store
Cold store small files on paper as QR codes -- PGP keys, Bitcoin keys, Tox keys or any other small files in general.
Stars: ✭ 28 (-89.06%)
Mutual labels:  qrcode
QRCodeFX
Simple tool to generate/read QR Code and export it.
Stars: ✭ 31 (-87.89%)
Mutual labels:  qrcode
barcode-server
Barcode Server for Barcode Client-Server android application
Stars: ✭ 40 (-84.37%)
Mutual labels:  qrcode
quur-swift
Minimal QR code Read/Write framework for Swift
Stars: ✭ 22 (-91.41%)
Mutual labels:  qrcode
DDYQRCode
二维码/条形码生成,二维码扫描(相机/图片/相册扫描),光强检测(开灯),扫描结果音效,扫描镂空界面,各种样式二维码
Stars: ✭ 13 (-94.92%)
Mutual labels:  qrcode
BGAQRCode-Android
QRCode 扫描二维码、扫描条形码、相册获取图片后识别、生成带 Logo 二维码、支持微博微信 QQ 二维码扫描样式
Stars: ✭ 7,714 (+2913.28%)
Mutual labels:  qrcode
qrcode
QR Code generator function for the FaaS Platform in #golang
Stars: ✭ 17 (-93.36%)
Mutual labels:  qrcode
TastyToasty
An easy-to-use library to create tasty 😋 Toasts with a bunch of flavours 🌈. It also provides effortless methods to create Instagram like Toasts 💓
Stars: ✭ 54 (-78.91%)
Mutual labels:  colorful
greenpass-covid19-qrcode-decoder
An easy tool for decoding Green Pass Covid-19 QrCode
Stars: ✭ 64 (-75%)
Mutual labels:  qrcode
2FAuth
A Web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes
Stars: ✭ 664 (+159.38%)
Mutual labels:  qrcode
react-native-smart-code
Support React & ReactNative.In react-native,it's create base64 String,which is qrcode or barcode ,and without webview.In react,we use jsbarcode.
Stars: ✭ 14 (-94.53%)
Mutual labels:  qrcode
QRCode
A QRCode Generator in Swift
Stars: ✭ 67 (-73.83%)
Mutual labels:  qrcode

go-qrcode

Go Report Card go.dev reference Go GitHub release (latest SemVer) GitHub go.mod Go version License

QR code (abbreviated from Quick Response Code) is the trademark for a type of matrix barcode (or two-dimensional barcode) first designed in 1994 for the automotive industry in Japan. A barcode is a machine-readable optical label that contains information about the item to which it is attached. A QR code uses four standardized encoding modes (numeric, alphanumeric, byte/binary, and kanji) to store data efficiently; extensions may also be used

Features

  • Normally generate QR code across version 1 to version 40.
  • Automatically analyze QR version by source text.
  • Specifying cell shape allowably with WithCustomShape, WithCircleShape (default is rectangle)
  • Specifying output file's format with WithBuiltinImageEncoder, WithCustomImageEncoder (default is JPEG)
  • Not only shape of cell, but also color of QR Code background and foreground color.
  • WithLogoImage, WithLogoImageFilePNG, WithLogoImageFileJPEG help you add an icon at the central of QR Code.
  • WithBorderWidth allows to specify any width of 4 sides around the qrcode.
  • WebAssembly support, check out the Example and README for more detail.
  • support Halftone QR Codes, check out the Example.

Install

go get -u github.com/yeqown/go-qrcode/v2

Quick Start

link to CODE

package main

import (
	"github.com/yeqown/go-qrcode/v2"
	"github.com/yeqown/go-qrcode/writer/standard"
)

func main() {
	qrc, err := qrcode.New("https://github.com/yeqown/go-qrcode")
	if err != nil {
		fmt.Printf("could not generate QRCode: %v", err)
		return
	}
	
	w, err := standard.New("../assets/repo-qrcode.jpeg")
	if err != nil {
		fmt.Printf("standard.New failed: %v", err)
		return
	}
	
	// save file
	if err = qrc.Save(w); err != nil {
		fmt.Printf("could not save image: %v", err)
	}
}

Options

const (
	// EncModeNone mode ...
	EncModeNone encMode = 1 << iota
	// EncModeNumeric mode ...
	EncModeNumeric
	// EncModeAlphanumeric mode ...
	EncModeAlphanumeric
	// EncModeByte mode ...
	EncModeByte
	// EncModeJP mode ...
	EncModeJP
)

// WithEncodingMode sets the encoding mode.
func WithEncodingMode(mode encMode) EncodeOption {}

const (
	// ErrorCorrectionLow :Level L: 7% error recovery.
	ErrorCorrectionLow ecLevel = iota + 1
	
	// ErrorCorrectionMedium :Level M: 15% error recovery. Good default choice.
	ErrorCorrectionMedium
	
	// ErrorCorrectionQuart :Level Q: 25% error recovery.
	ErrorCorrectionQuart
	
	// ErrorCorrectionHighest :Level H: 30% error recovery.
	ErrorCorrectionHighest
)

// WithErrorCorrectionLevel sets the error correction level.
func WithErrorCorrectionLevel(ecLevel ecLevel) EncodeOption {}

following are some shots:


Built-in Writers

Of course, you can also code your own writer, just implement Writer interface.

Migrating from v1

go-qrcode.v2 is a major upgrade from v1, and it is not backward compatible. v2 redesigned the API, and it is more flexible and powerful. Features are split into different modules (according to functionality).

  • github.com/yeqown/go-qrcode/v2 core
  • github.com/yeqown/go-qrcode/writer/standard writer/imageFile
  • github.com/yeqown/go-qrcode/writer/terminal writer/terminal

Check example/migrating-from-v1 for more details.

Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].