Skip to content

Instantly share code, notes, and snippets.

Created Oct 5, 2017
What would you like to do?
A simple program to print QR Codes on your terminal
// Copyright 2017 Google Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to writing, software distributed
// under the License is distributed on a "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
qr ""
func main() {
c, err := qr.New("", qr.Highest)
if err != nil {
for _, row := range c.Bitmap() {
for _, cell := range row {
if cell {
fmt.Printf("\033[40m \033[0m")
} else {
fmt.Printf("\033[47m \033[0m")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment