Skip to content

YuriyLisovskiy/qrcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR Code Generator

License Minimum Go Version Go Documentation Build Status Coverage Status

Installation

$ go get -u github.com/YuriyLisovskiy/qrcode/qr

Usage

Import package with

import "github.com/YuriyLisovskiy/qrcode/qr"
// Text to encode.
const TEXT =
`
Nibh. Pulvinar enim porttitor tellus litora
nec vestibulum sit montes class, euismod odio
litora venenatis suscipit mi cras arcu a
dictum risus vestibulum parturient pellentesque
sociosqu vel rutrum a eros.
`

// Create an instance of Generator.
qrGen := qr.Generator{}

// Encode the text.
qrGen = qrGen.EncodeText(TEXT)

// Create an image of generated qr code.
qrGen.DrawImage("path/to/qr.png", 4, 500)

Result image:

Run

  • tests: make test
  • demo: make demo

Author

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.