Pure js wifi qr code generator

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

NPM module to generate a QR Code to connect to your WiFi. Supports WiFi QR Codes in PNG, SVG, Terminal and UTF output formats. Works in both node server and browser.

License

fantasywidgets/wifi-qr-code-generator

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Welcome to wifi-qr-code-generator 👋

⭐️ Star us on GitHub — it helps!

wifi-qr-code-generator is an npm module to generate a QR Code to connect to your WiFi. Supports WiFi QR Codes in PNG, SVG, Terminal and UTF output formats. Works in both node server and browser.

$ npm install wifi-qr-code-generator
$ yarn add wifi-qr-code-generator

Basic API — Generating a PNG QR Code

const qrcode = require('wifi-qr-code-generator') const pr = qrcode.generateWifiQRCode( ssid: 'Hello world', password: 'testpass', encryption: 'WPA', hiddenSSID: false, outputFormat:  type: 'image/png' > >) pr.then((data) => console.log(data))

This prints the following output:

data:image/png;base64,iVBORw0KGgoAAA. 

You can pass this data URL to an html img tag to generate the following QR code image:

Main API call is generateWifiQRCode which is shown in the example above. This method takes an object of the following format:

export interface Config  ssid: string password: string encryption: 'WPA' | 'WEP' | 'None' hiddenSSID: boolean outputFormat: OutputFormat > export interface OutputFormat  type: 'image/png' | 'utf8' | 'svg' | 'terminal' >
  1. ssid : string representation of your wireless SSID (Wifi name). Max length possible for WiFi SSID is 32 characters for most routers. However this library doesn’t impose any limitation on the length of SSID that can be passed in.
  2. password : string representation of your WiFi password
  3. encryption : Possible values here are WPA , WEP and None . If you are using WPA2, enter WPA . Please note that WEP protocol has multiple security vulnerabilities and you shouldn’t be configuring your WiFi router to use WEP at all.
  4. hiddenSSID : should be true if your router is configured to NOT broadcast your SSID. Else false
  5. outputFormat : An object that has a single type field

Possible values of type are:

  1. «image/png» : generateWifiQRCode will generates a data URL representing a PNG image
  2. «svg» : generateWifiQRCode will generates an SVG image in string format
  3. utf8 : generateWifiQRCode will generates a UTF8 representation of the QR code
  4. terminal : generateWifiQRCode will generates a string that can be pretty printed as QR code in the terminal
const qrcode = require('wifi-qr-code-generator') const pr = qrcode.generateWifiQRCode( ssid: 'Hello world', password: 'testpass', encryption: 'WPA', hiddenSSID: false, outputFormat:  type: 'svg' > >) pr.then((data) => console.log(data))

This prints the following output:

You can use the generated SVG directly in your HTML page to display the QR code.

Generating a UTF8 QR Code

const qrcode = require('wifi-qr-code-generator') const pr = qrcode.generateWifiQRCode( ssid: 'Hello world', password: 'testpass', encryption: 'WPA', hiddenSSID: false, outputFormat:  type: 'utf8' > >) pr.then((data) => console.log(data))

This prints the following output:

Generating a Terminal QR Code

const qrcode = require('wifi-qr-code-generator') const pr = qrcode.generateWifiQRCode( ssid: 'Hello world', password: 'testpass', encryption: 'WPA', hiddenSSID: false, outputFormat:  type: 'terminal' > >) pr.then((data) => console.log(data))

This generates the following QR code in your terminal:

terminal-screenshot-qr-code

👤 Anoop Kunjuraman

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Give a ⭐️ if this project helped you!

Copyright © 2020 Anoop Kunjuraman.
This project is MIT licensed.

This README was generated with ❤️ by readme-md-generator

About

NPM module to generate a QR Code to connect to your WiFi. Supports WiFi QR Codes in PNG, SVG, Terminal and UTF output formats. Works in both node server and browser.

Источник

About

Ever wanted to create a cool QR code for your guests? But never wanted to type in your WiFi credentials into a form that submits them to a remote webserver to render the QR code? QiFi for the rescue! It will render the code in your browser, on your machine, so the WiFi stays as secure as it was before (read the code if you do not trust text on the internet :-))!

If you use the Save-button to store a code, this is still secure, as the data is stored in HTML5 localStorage and is never transmitted to the server (in contrast to cookie-based solutions).

Don’t trust your browser either? Just pipe the string WIFI:S:;T:;P:;; through the QR code generator of your choice after reading the documentation.

Supported Scanners

Android

The Android Camera App has support for WiFi QR codes since Android 10.

Huawei phones have a QR code scanner in HiVision mode. This mode has an eye-shaped icon and can be lauched from the lock screen by swiping up or from the camera.

Every other Android Barcode Scanner based on the ZXing library.

iOS

QR Reader for iPhone from TapMedia and Avira Insight QR Code Scanner by Avira Holding GmbH & Co. KG also support WiFi QR codes. Please note: Due to iOS design, third-party apps cannot modify WiFi settings directly and you’ll have to copy&paste the details.

Maemo

Other

Every other QR scanner out there should be able to scan the code too, but probably won’t interpret it as intended. If your scanner supports WiFi QR codes, please send me a mail!

Contact

If you have any comments, suggestions, bugs or complaints: please write to: evgeni+qifi@golov.de.

qifi logo

by @evgeni
QR Code is a registered trademark of DENSO WAVE INCORPORATED in the United States and other countries.

Источник

About

Ever wanted to create a cool QR code for your guests? But never wanted to type in your WiFi credentials into a form that submits them to a remote webserver to render the QR code? QiFi for the rescue! It will render the code in your browser, on your machine, so the WiFi stays as secure as it was before (read the code if you do not trust text on the internet :-))!

If you use the Save-button to store a code, this is still secure, as the data is stored in HTML5 localStorage and is never transmitted to the server (in contrast to cookie-based solutions).

Don’t trust your browser either? Just pipe the string WIFI:S:;T:;P:;; through the QR code generator of your choice after reading the documentation.

Supported Scanners

Android

Huawei phones have a QR code scanner in HiVision mode. This mode has an eye-shaped icon and can be lauched from the lock screen by swiping up or from the camera.

Every other Android Barcode Scanner based on the ZXing library.

Maemo

iOS

QR Reader for iPhone from TapMedia and Avira Insight QR Code Scanner by Avira Holding GmbH & Co. KG also support WiFi QR codes. Please note: Due to iOS design, third-party apps cannot modify WiFi settings directly and you’ll have to copy&paste the details. The only alternative would be downloading a mobile profile from the Internet, but that would mean leaking your credentials to a third-party.

Other

Every other QR scanner out there should be able to scan the code too, but probably won’t interpret it as intended. If your scanner supports WiFi QR codes, please send me a mail!

Contact

If you have any comments, suggestions, bugs or complaints: please write to: evgeni+qifi@golov.de.

qifi logo

by @evgeni
QR Code is a registered trademark of DENSO WAVE INCORPORATED in the United States and other countries.

Источник

About

Ever wanted to create a cool QR code for your guests? But never wanted to type in your WiFi credentials into a form that submits them to a remote webserver to render the QR code? QiFi for the rescue! It will render the code in your browser, on your machine, so the WiFi stays as secure as it was before (read the code if you do not trust text on the internet :-))!

If you use the Save-button to store a code, this is still secure, as the data is stored in HTML5 localStorage and is never transmitted to the server (in contrast to cookie-based solutions).

Don’t trust your browser either? Just pipe the string WIFI:S:;T:;P:;; through the QR code generator of your choice after reading the documentation.

Supported Scanners

Android

The Android Camera App has support for WiFi QR codes since Android 10.

Huawei phones have a QR code scanner in HiVision mode. This mode has an eye-shaped icon and can be lauched from the lock screen by swiping up or from the camera.

Every other Android Barcode Scanner based on the ZXing library.

iOS

QR Reader for iPhone from TapMedia and Avira Insight QR Code Scanner by Avira Holding GmbH & Co. KG also support WiFi QR codes. Please note: Due to iOS design, third-party apps cannot modify WiFi settings directly and you’ll have to copy&paste the details.

Maemo

Other

Every other QR scanner out there should be able to scan the code too, but probably won’t interpret it as intended. If your scanner supports WiFi QR codes, please send me a mail!

Contact

If you have any comments, suggestions, bugs or complaints: please write to: evgeni+qifi@golov.de.

qifi logo

by @evgeni
QR Code is a registered trademark of DENSO WAVE INCORPORATED in the United States and other countries.

Источник

About

Ever wanted to create a cool QR code for your guests? But never wanted to type in your WiFi credentials into a form that submits them to a remote webserver to render the QR code? QiFi for the rescue! It will render the code in your browser, on your machine, so the WiFi stays as secure as it was before (read the code if you do not trust text on the internet :-))!

If you use the Save-button to store a code, this is still secure, as the data is stored in HTML5 localStorage and is never transmitted to the server (in contrast to cookie-based solutions).

Don’t trust your browser either? Just pipe the string WIFI:S:;T:;P:;; through the QR code generator of your choice after reading the documentation.

Supported Scanners

Android

Every other Android Barcode Scanner based on the ZXing library.

Maemo

iOS

QR Reader for iPhone from TapMedia and Avira Insight QR Code Scanner by Avira Holding GmbH & Co. KG also support WiFi QR codes. Please note: Due to iOS design, third-party apps cannot modify WiFi settings directly and you’ll have to copy&paste the details. The only alternative would be downloading a mobile profile from the Internet, but that would mean leaking your credentials to a third-party.

Other

Every other QR scanner out there should be able to scan the code too, but probably won’t interpret it as intended. If your scanner supports WiFi QR codes, please send me a mail!

Contact

If you have any comments, suggestions, bugs or complaints: please write to: evgeni+qifi@golov.de.

qifi logoby @evgeni
Flattr this

Источник

Читайте также:  Ноутбуке wifi пишет нет доступных подключений
Оцените статью
Adblock
detector