Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/windomz/qrw
:high_brightness: Output QR codes for Go
https://github.com/windomz/qrw
library qr-code qr-generator qrcode-generator
Last synced: about 2 months ago
JSON representation
:high_brightness: Output QR codes for Go
- Host: GitHub
- URL: https://github.com/windomz/qrw
- Owner: WindomZ
- License: mit
- Created: 2018-03-24T13:21:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-20T15:55:36.000Z (over 6 years ago)
- Last Synced: 2024-10-11T20:24:09.899Z (2 months ago)
- Topics: library, qr-code, qr-generator, qrcode-generator
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QRCode Writer
> Output QR codes for Go
[![Build Status](https://travis-ci.org/WindomZ/qrw.svg?branch=master)](https://travis-ci.org/WindomZ/qrw)
[![Coverage Status](https://coveralls.io/repos/github/WindomZ/qrw/badge.svg?branch=master)](https://coveralls.io/github/WindomZ/qrw?branch=master)
[![GoDoc](https://godoc.org/github.com/WindomZ/qrw?status.svg)](https://godoc.org/github.com/WindomZ/qrw)## Features
- [x] Output to **text**
- [x] two characters as a block
- [x] half character as a block
- [x] Output to **terminal**
- [x] bash
- [x] zsh
- [x] Output to **file**
- [x] text
- [x] png
- [x] jpeg## Example
As shown in the figure, you can get started quickly with the following example:![image](https://user-images.githubusercontent.com/14875359/37985673-04e85e8a-322c-11e8-882e-dc8b49d215c7.png)
### BlockWriter
Show a QR block by _two characters_.##### Output to `io.Writer`:
```
BlockWrite(os.Stdout, L, "Hello world!")
```##### Output to `file`:
```
BlockWriteFile("file_path", L, "Hello world!")
```### HalfBlockWriter
Show a QR block by _half character_.##### Output to `io.Writer`:
```
HalfBlockWrite(os.Stdout, L, "Hello world!")
```##### Output to `file`:
```
HalfBlockWriteFile("file_path", L, "Hello world!")
```## Usage
Common functions:
```
func BlockWrite(io.Writer, Level, string) error
func BlockWriteFile(string, Level, string) error
func HalfBlockWrite(io.Writer, Level, string) error
func HalfBlockWriteFile(string, Level, string) error
func Bash(Level, string) error
func PNG(string, Level, string) error
func JPEG(string, Level, string) error
```See [document](https://godoc.org/github.com/WindomZ/qrw).
### Level(error correction level)
From least to most tolerant of errors:
- `L` 20% redundant
- `M` 38% redundant
- `Q` 55% redundant
- `H` 65% redundantThe definitions comes from [rsc/qr](https://github.com/rsc/qr/blob/master/qr.go#L23).
## Install
```bash
go get -u github.com/WindomZ/qrw
```## Related
- Driven by [rsc/qr](https://github.com/rsc/qr)
- Inspired by [mdp/qrterminal](https://github.com/mdp/qrterminal)