wifiqr

package module
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2022 License: MIT Imports: 4 Imported by: 0

README

Wi-Fi QR Code Generator

Test Status PkgGoDev Go Report Card codecov

Create a QR code with your Wi-Fi login details.

Use Google Lens or other application to scan it and connect automatically.

Installation

Choose a binary from the releases.

Build from Source

Download and install Go.

Get the package:

go get github.com/reugn/wifiqr

Read this guide on how to compile and install the application.

Usage

$ wifiqr --help
wifiqr is a WiFi QR code generator

It is used to create a QR code containing the login details such as
the name, password, and encryption type. This QR code can be scanned
using Google Lens or other QR code reader to connect to the network.
It is Android and iOS compatible.

If the options necessary for creating the QR code are not given on
the command line, the user will be prompted for the information.

Usage:
  wifiqr [flags]

Flags:
  -h, --help              help for wifiqr
      --hidden            Hidden SSID
  -k, --key string        Wireless password (pre-shared key / PSK)
  -o, --output string     PNG file for output (default stdout)
  -p, --protocol string   Wireless network encryption protocol (WPA2, WPA, WEP, NONE). (default "WPA2")
  -s, --size int          Image width and height in pixels (default 256)
  -i, --ssid string       Wireless network name
  -v, --version           version for wifiqr

Usage Example

./wifiqr --ssid some_ssid --key 1234 --output qr.png --size 128

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCode

func InitCode(config *Config) (*qrcode.QRCode, error)

InitCode returns the qrcode.QRCode based on the configuration.

Types

type Config

type Config struct {
	// The Service Set Identifier (SSID) is the name of the wireless network.
	// It can be contained in the beacons sent out by APs, or it can be ‘hidden’ so that clients
	// who wish to associate must first know the name of the network. Early security guidance was
	// to hide the SSID of your network, but modern networking tools can detect the SSID by simply
	// watching for legitimate client association, as SSIDs are transmitted in cleartext.
	SSID string
	// A pre-shared key (PSK).
	Key string
	// The wireless network encryption protocol (WEP, WPA, WPA2).
	Encryption EncryptionProtocol
	// Defines if the SSID is ‘hidden’.
	Hidden bool
}

Config is the Wi-Fi network configuration parameters.

func NewConfig

func NewConfig(ssid string, key string, enc EncryptionProtocol, hidden bool) *Config

NewConfig returns a new Config.

type EncryptionProtocol added in v0.3.0

type EncryptionProtocol int

EncryptionProtocol represents a WiFi encryption protocol.

const (
	WPA2 EncryptionProtocol = iota
	WPA
	WEP
	NONE
)

func NewEncryptionProtocol added in v0.3.0

func NewEncryptionProtocol(t string) (EncryptionProtocol, error)

NewEncryptionProtocol returns a new EncryptionProtocol from the specified string.

func (EncryptionProtocol) Code added in v0.3.0

func (ep EncryptionProtocol) Code() string

Code returns a string code for the EncryptionProtocol.

func (EncryptionProtocol) String added in v0.3.0

func (ep EncryptionProtocol) String() string

String returns the string representation of the EncryptionProtocol.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL