Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fameless4elll/qrcode
QR code generator. It includes functionality to encode data into a QR code
https://github.com/fameless4elll/qrcode
golang qrcode
Last synced: 19 days ago
JSON representation
QR code generator. It includes functionality to encode data into a QR code
- Host: GitHub
- URL: https://github.com/fameless4elll/qrcode
- Owner: Fameless4ellL
- License: mit
- Created: 2024-12-21T11:18:45.000Z (20 days ago)
- Default Branch: main
- Last Pushed: 2024-12-21T12:01:27.000Z (20 days ago)
- Last Synced: 2024-12-21T13:19:04.372Z (20 days ago)
- Topics: golang, qrcode
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QR Code Generator
This project is a QR Code generator written in Go that allows you to create QR codes for various types of data, such as URLs, text, and more.
## Installation
To install the necessary dependencies, run the following command:
```bash
go get -u https://github.com/Fameless4ellL/qrcode
```## Usage
Here is an example of how to use the QR Code generator:
```go
package mainimport (
"log"
"qrcode/constants"
"qrcode/image"
"qrcode/qr"
)func main() {
version := 0
errorCorrection := constants.ERROR_CORRECT_L
boxSize := 30
border := 2
maskPattern := 5q, err := qr.NewQRCode(version, errorCorrection, boxSize, border, image.PilImage{}, maskPattern)
if err != nil {
log.Fatal(err)
}
q.SetVersion(4)data := "Hello, world!"
if err := q.AddData(data, 0); err != nil {
log.Fatal(err)
}
q.PrintASCII(
nil,
false,
false,
)
}```
This will generate a QR code with the text "Hello, world!" in the terminal.
![QR Code](files/qrcode.png)## TODO
- Implement functionality to generate QR code images.
- Add options to customize the QR code (e.g., colors, size, error correction level).## License
This project is licensed under the MIT License.