Code Monkey home page Code Monkey logo

kmgqrcode's Introduction

Description

GoDoc GitHub issues GitHub stars GitHub forks MIT License

a golang qrcode writer

A QR Code is a matrix (two-dimensional) barcode. Arbitrary content may be encoded.

A QR Code contains error recovery information to aid reading damaged or obscured codes. There are four levels of error recovery: qrcode.{Low, Medium, High, Highest}. QR Codes with a higher recovery level are more robust to damage, at the cost of being physically larger.

The maximum capacity of a QR Code varies according to the content encoded and the error recovery level. The maximum capacity is 2,953 bytes, 4,296 alphanumeric characters, 7,089 numeric digits, or a combination of these.

This package implements a subset of QR Code 2005, as defined in ISO/IEC 18004:2006.

Example

package main

import (
	"github.com/bronze1man/kmgQrcode"
	"io/ioutil"
)

func main(){
	resp:= kmgQrcode.MustEncode(kmgQrcode.EncodeReq{
		Content: "https://www.google.com/",
	})
	err:=ioutil.WriteFile("tmp.png",resp.PngContent,0777)
	if err!=nil{
		panic(err)
	}
}

Notice

  • It can not read qrcode into text, it can only translate qrcode text into png byte slice.
  • fork from https://github.com/skip2/go-qrcode , with following change:
    • Make the package name easy to remember and import.
    • Simplify the caller interface, leave only one function kmgQrcode.MustEncode .
    • Delete surrounding blank, make the qrcode part as large as possible.(use float64 instead of int to generate image.)

kmgqrcode's People

Contributors

bronze1man avatar

Stargazers

Mohsen Davari avatar

Watchers

James Cloos avatar  avatar

Forkers

isabella232

kmgqrcode's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.