Basic QR encoder.
go get [-u] rsc.io/qr
QR codes
License: BSD 3-Clause "New" or "Revised" License
Basic QR encoder.
go get [-u] rsc.io/qr
Possibly to do with this entry in the release notes
Release Note:
The internal representation of the output code has been slightly changed - the second bit from LSB side now represents; 1:ECC bit / 0:data bit. This change is only for debug purposes and does not affect user applications.
--- FAIL: TestVersion (0.01s)
qr_test.go:87: 1/7: Pixel[0][9] = data+black+137, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[0][10] = data+invert+136, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[0][11] = data+black+135, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[0][12] = data+black+invert+134, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[1][9] = data+black+invert+139, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[1][10] = data+invert+138, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[1][11] = data+black+invert+133, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[1][12] = data+132, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[2][9] = data+black+141, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[2][10] = data+invert+140, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[2][11] = data+invert+131, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[2][12] = data+black+invert+130, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[3][9] = data+black+invert+143, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[3][10] = data+142, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[3][11] = data+black+invert+129, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[3][12] = data+128, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[4][9] = data+145, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[4][10] = data+144, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[4][11] = data+127, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[4][12] = data+black+invert+126, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[5][9] = data+invert+147, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[5][10] = data+146, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[5][11] = data+black+125, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[5][12] = data+black+124, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[7][9] = data+black+invert+149, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[7][10] = data+black+invert+148, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[7][11] = data+black+invert+123, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[7][12] = data+black+122, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[8][9] = data+black+151, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[8][10] = data+black+invert+150, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[8][11] = data+invert+121, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[8][12] = data+invert+120, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[9][11] = data+invert+119, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[9][12] = data+118, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[9][13] = data+invert+73, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[9][14] = data+black+72, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[9][15] = data+invert+71, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[9][16] = data+70, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[9][17] = data+invert+25, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[9][18] = data+24, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[9][19] = data+black+invert+23, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[9][20] = data+black+22, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[10][11] = data+117, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[10][12] = data+black+invert+116, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[10][13] = data+black+invert+75, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[10][14] = data+invert+74, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[10][15] = data+69, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[10][16] = data+68, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[10][17] = data+black+27, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[10][18] = data+black+invert+26, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[10][19] = data+invert+21, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[10][20] = data+black+invert+20, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[11][11] = data+black+115, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[11][12] = data+114, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[11][13] = data+invert+77, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[11][14] = data+invert+76, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[11][15] = data+invert+67, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[11][16] = data+66, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[11][17] = data+black+29, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[11][18] = data+28, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[11][19] = data+black+invert+19, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[11][20] = data+black+invert+18, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[12][11] = data+113, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[12][12] = data+black+invert+112, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[12][13] = data+79, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[12][14] = data+black+invert+78, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[12][15] = data+65, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[12][16] = data+black+invert+64, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[12][17] = data+31, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[12][18] = data+invert+30, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[12][19] = data+17, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[12][20] = data+invert+16, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[13][11] = data+black+invert+111, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[13][12] = data+110, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[13][13] = data+81, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[13][14] = data+80, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[13][15] = data+black+invert+63, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[13][16] = data+black+invert+62, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[13][17] = data+invert+33, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[13][18] = data+black+32, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[13][19] = data+15, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[13][20] = data+black+14, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[14][11] = data+invert+109, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[14][12] = data+invert+108, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[14][13] = data+black+83, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[14][14] = data+82, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[14][15] = data+black+61, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[14][16] = data+invert+60, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[14][17] = data+black+invert+35, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[14][18] = data+black+invert+34, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[14][19] = data+black+13, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[14][20] = data+12, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[15][11] = data+black+invert+107, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[15][12] = data+black+106, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[15][13] = data+black+invert+85, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[15][14] = data+84, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[15][15] = data+black+invert+59, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[15][16] = data+black+58, want unused+black+0 0x1
qr_test.go:87: 1/7: Pixel[15][17] = data+invert+37, want unused+0 0x0
qr_test.go:87: 1/7: Pixel[15][18] = data+36, want unused+0 0x0
qr_test.go:89: stopping after 100 bad pixels
etc...
I faced an unexpected error while trying to go get github.com/claudiodangelis/qr-filetransfer
through a 2 level dependency chain:
➜ GOPATH=~/installs/go-tools go get -u -v github.com/claudiodangelis/qr-filetransfer
github.com/claudiodangelis/qr-filetransfer (download)
github.com/jhoonb/archivex (download)
github.com/mattn/go-colorable (download)
github.com/mattn/go-isatty (download)
github.com/mdp/qrterminal (download)
github.com/rsc/qr (download)
package github.com/rsc/qr: code in directory /home/suhaskaranth/installs/go-tools/src/github.com/rsc/qr expects import "rsc.io/qr"
Specifically, github.com/claudiodangelis/qr-filetransfer ➜ github.com/mdp/qrterminal ➜ github.com/rsc/qr
. My understanding was that this was due to an incorrect import of this module - mdp/qrterminal:qrterminal.go@44bd8ed
#L7. And I opened a PR to correct the same - mdp/qrterminal#10. I wanted to confirm that this is indeed the right course of action and no change is required in this module, hence this issue.
Hey Russ,
What would it take to get this running via Wasmer? Right now I get:
$ wasmer run main.wasm
error: failed to run `main.wasm`
│ 1: module instantiation failed (compiler: cranelift)
╰─▶ 2: WebAssembly translation error: Error when converting wat: input bytes aren't valid utf-8
I'd love to be able to provide the URL and image as command line arguments. I think your project would get a lot of use if people could access it like this from the CLI, or as a WASM module they include in other projects.
Provided the result is constrained to proper URL syntax, the user can always go and register the domain after they've got the image they want and put a redirect there.
I have not thought clearly on the way to achieve this. I guess there's a matter of whether the length of the hostname should vary until .com
lands on the most similar pixels, or if there should be a deeper search using various TLDs which the user could register (geography and budgets complicate this, I guess).
(BTW, this drive-by is a result of me trying to figure out how to relax the constraints on valid QR Code input to QR Code Monster)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.