
Pure JavaScript WiFi QR Code Generator - cow9
https://qifi.org/
======
daxterspeed
On the topic of generating QR codes with JavaScript, I have a project that
requires generating QR codes and the various libraries I could find all seemed
to be rather... poor. A lot of them were simply made for another era of
JavaScript, where the only way to generate the image was to set up a table, or
even implement its own png encoder(?). There were a few more modern ones, with
active development, but the changelogs weren't terrible re-assuring as they
were mostly fixing bugs that really shouldn't happen in a standards compliant
code generator.

In the end I settled on Project Nayuki's QR code library[0]. The JavaScript is
targeting ECMAScript 5, but is commented really well so it's not too difficult
to refactor it into ES6+. I'm hoping to publish my efforts soon, but it still
needs some more work.

[0] [https://www.nayuki.io/page/qr-code-generator-
library](https://www.nayuki.io/page/qr-code-generator-library)

~~~
nayuki
Thanks for the compliments! So actually, the ES5 targeting is my conscious
choice for supporting Internet Explorer 11.

Otherwise, you can see the use of the latest and greatest features in the
TypeScript version: [https://github.com/nayuki/QR-Code-
generator/blob/master/type...](https://github.com/nayuki/QR-Code-
generator/blob/master/typescript/qrcodegen.ts?ts=4)

I began this project in 2016 because I got disappointed by code quality when
browsing online for C/C++ QR libs. The JavaScript versions were even worse,
especially ones that ported C code poorly and verbosely. On my web page, the
bottom section titled "Compared to competitors" contains a detailed
commentary.

On a related note, here you can learn about how QR Codes work at a low level:
[https://www.nayuki.io/page/creating-a-qr-code-step-by-
step](https://www.nayuki.io/page/creating-a-qr-code-step-by-step)

~~~
noir_lord
Just wanted to compliment you, this is a seriously impressive amount of work.

I deal with QR codes at work (we use them for stock tracking) and the
libraries previous Dev used aren't a patch on yours :).

------
mustardo
Anyone from Google know what the deal is with barcode scanners on Android,
zxing is in "maintenance mode" we have recently added QR scanning to our app
and the experience on iOS is far superior (integrated, faster etc). Or do you
have to mothball zxing for a period of time before launching a new "scanner
product" to get that team promoted before abandoning it as part of the Google
SDLC (Build, Promote, Abandon)

~~~
matharmin
ZXing isn't an official Google product, although it was created by an ex-
Googler (perhaps still at Google at the time).

Google itself has a "Barcode API", but they seem to recommend "ML Kit" these
days.

~~~
kebman
Yeah that API was a no-go for me, as I don't really want to share all that
data with Google. So I was stuck with ZXing.

~~~
cameronbrown
ML Kit runs on-device if sending to Cloud is your worry.

------
jraph
Coincidentally, as of this week, Plasma (KDE) adds a feature to see the QR
code of a network "for easy sharing with others"

\- [https://pointieststick.com/2019/07/21/kde-usability-
producti...](https://pointieststick.com/2019/07/21/kde-usability-productivity-
week-80/)

\- [https://phabricator.kde.org/D22457](https://phabricator.kde.org/D22457)

Also, I really like KDE clipboard's manager feature that turns what you copied
into a QR code, making it easy to pass data from the computer to a phone. KDE
Connect goes further by allowing sharing the clipboard between a phone and a
computer but:

\- at times, KDE connect is unavailable without tweaking because you are on a
WiFi connection that does not allow communication between devices

\- you might not want to share the clipboard between the computer and the
phone for privacy reasons

\- you may want to share something to somebody else's phone

------
jessedhillon
Neat!

You could update/simplify your Android instructions: the stock camera app will
detect QR codes and present a button to connect to the network in the link
(tested using Pixel 3 running Android Pie)

edit: per the below comment, this is the app, which may or may not be
installable on your phone:
[https://play.google.com/store/apps/details?id=com.google.and...](https://play.google.com/store/apps/details?id=com.google.android.GoogleCamera&hl=en_US)

~~~
ehsankia
Oh this is great. I first tried it with Google Lens, which supports normal QR
codes, but unfortunately didn't do anything at all with these.

------
ohnope
I love that this is supported on iOS. I was curious to know about more
supported shortcuts, and found this list:

[https://9to5mac.com/2017/06/12/top-10-qr-codes-supported-
by-...](https://9to5mac.com/2017/06/12/top-10-qr-codes-supported-by-ios-11/)

~~~
rolltiide
Its been so nice since iOS has had a QR code reader natively in the camera for
a few years

Mobile devices having this natively was a dream back in the beginning of the
decade

Android OS doesnt have this natively so the devices dont reliably have that
still

Reason 25 to just stay away since there a fundamental limitations to android
getting better that have nothing to do with overpowered hardware and
customization

~~~
captn3m0
How is this 2019 and Android doesn’t natively scab QR codes?

~~~
rolltiide
Could be a variety of factors ranging from apathy to intellectual property,
very unlikely to be the OEM hardware or software variances, but it also could
be

At this point just bet on winners

~~~
captn3m0
Last I checked, the Pixel phones did this with the Camera app, but the One
Plus did not.

Why can't Google add this to the "Android certification" to force everyone to
read QR codes on the default Camera application

------
ram_rattle
Inspite of captive portal being everywhere this is a very good tool for
SME's/hotels which doesn't afford to have portal. Good job mate.

~~~
drspacemonkey
I've got a wifi QR code printed and hung on the wall of my apartment. It's
nice to be able to tell guests to just scan the QR code instead of giving them
my very long wifi password.

------
voltagex_
I can crash Settings on my up to date Galaxy Note 9 by entering enough 'a's as
SSID and password. Wonder if it's more than a crash?

~~~
moron4hire
That's Samsung in general. I have a TV that can't handle long passwords.

------
oceanghost
This is fantastic. I'm going to 3d print the code and make a placard for the
guest WiFi at my place :)

~~~
oceanghost
Ok, so someone already did this...

[https://www.thingiverse.com/thing:3181601](https://www.thingiverse.com/thing:3181601)

~~~
kebman
Is that thing even scannable? Or do they paint the embossed parts for extra
contrast?

~~~
bbernoulli
From the description on the page:

> You need to print this with a light color on the bottom and a darker color
> on the top layers, otherwise it will not scan correctly.

------
sschueller
Here is one based on jquery-qrcode [1].
[http://qrtrack.com/](http://qrtrack.com/)

[1] [https://larsjung.de/jquery-qrcode/](https://larsjung.de/jquery-qrcode/)

------
tstevens
Looks like Android Q has support for reading WiFi QR codes.

To scan a code, tap the button on the far right of the "Add network" line in
the WiFi settings.

[https://www.androidpolice.com/2019/03/13/android-q-lets-
you-...](https://www.androidpolice.com/2019/03/13/android-q-lets-you-share-
and-connect-to-wifi-networks-with-qr-codes/)

------
dzhiurgis
Does anyone know why none of the popular banking and alt-banking apps support
SEPA payments vi QR code?

~~~
kebman
Banks are some of the most conservative institutions on earth. They also have
a lot to lose if they do it wrong, so progress is usually slow. There are some
who go against the grain, though, like for instance Revolut.

~~~
dzhiurgis
Neither Revolut nor Monese do that. Not sure Revolut supports SEPA payments at
all.

------
Freeboots
Im not really familiar with how qr codes actually work, ive wondered before if
its possible to add multiple networks/passowrds from a single qr code, or does
it not work that way?

~~~
johnchristopher
If I remember correctly, no. The encoded string has a format like
`WIFI:T:WPA;S:mynetwork;P:mypass;;` (see [https://cweiske.de/tagebuch/wifi-
config-qrcode.htm](https://cweiske.de/tagebuch/wifi-config-qrcode.htm)).

It's up to the qr code scanner to share the string with the appropriate app.

------
yuvadam
On a similar note, I created a very small and convenient service for client-
side generation of QR codes

[http://qrgen.xyz/](http://qrgen.xyz/)

------
theon144
>Maemo

Oh the memories! Makes me wonder how Neo900 is doing...

------
sergiomattei
Do regular people (outside the tech bubble) even use QR codes anymore?

Using them involves installing a reader app, and even when embedded in phone
camera apps, the functionality is hidden or implicit.

QR codes look cool and feel like the future, but they seem like something that
never really materialized in becoming widespread to the general populace.

Not arguing against this product per se, but QR codes in general...

~~~
daxterspeed
I feel like both Google and Apple has just want QR codes to go away. Some of
their apps use QR codes for very specific purposes, like setups, but neither
of them provide a generic QR code scanning app.

The Twitter app on Android actually has a built in generic QR scanner for
whatever reason, but for most purposes I use ZXing team's Barcode Scanner app.
I've been looking towards using a QR code keyboard to semi-safely let me input
complex passwords in apps.

[EDIT] Another reply notes that the Apple camera app actually does scan QR
codes out of the box. I haven't used an iPhone / iPod in years so made an
incorrect guess.

[EDIT] Apparently some Google made Android phones do actually have some QR
code support in the default camera app, but the Nexus 6P (Huawei, but under
the now defunct Nexus program) certainly doesn't.

~~~
pgeorgi
The Google Assistant/Lens stuff on Android phones has QR scanning integrated.

------
MertsA
Argh, no support for WPA Enterprise??? We're literally stuck with open
unencrypted networks with captive portal sign on because the configuration
process for WPA Enterprise is so convoluted. This would have been far more
helpful if it supported the networks that actually have a bunch of
configuration data rather than just an SSID and a password.

~~~
kebman
Perhaps you could offer some help with the project? :)

