wifiqr

package module
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 4 Imported by: 0

README

Wi-Fi QR Code Generator

Test Status PkgGoDev Go Report Card

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 https://golang.org/doc/install.

Get the package:

go get github.com/reugn/wifiqr

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

Usage

Usage of ./wifiqr:
  -enc string
        The wireless network encryption protocol (WPA2, WPA, WEP). (default "WPA2")
  -file string
        A png file to write the QR Code (prints to stdout if not set).
  -hidden
        Hidden SSID.
  -key string
        A pre-shared key (PSK). You'll be prompted to enter the key if not set.
  -size int
        Size is both the image width and height in pixels. (default 256)
  -ssid string
        The name of the wireless network. You'll be prompted to enter the SSID if not set.
  -version
        Show version.

Usage Example

./wifiqr -ssid some_ssid -key 1234 -file 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

type EncryptionProtocol int
const (
	WPA2 EncryptionProtocol = iota
	WPA
	WEP
)

func NewEncryptionProtocol

func NewEncryptionProtocol(t string) (EncryptionProtocol, error)

func (EncryptionProtocol) String

func (ep EncryptionProtocol) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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