qrcode-0.1: QR Code library in pure Haskell

PortabilityPortable
StabilityExperimental
Maintainerchris@kizzx2.com

Codec.Binary.QRCode

Contents

Description

An evolving QR Code encoder (and future decoder) in pure Haskell.

Currently supports encoding Numeric and Alphanumeric data.

Example

 encode (fromJust $ version 1) M Alphanumeric "hello world"

Synopsis

Operations

encode :: Version -> ErrorLevel -> Mode -> String -> Maybe MatrixSource

Returns Nothing if the input is invalid for the Mode specified.

toArray :: Bounded a => Matrix -> Array (Int, Int) aSource

Convert a Matrix to an array of Bounded Light modules will have the value maxBound; Dark modules will have the value minBound

width :: Matrix -> IntSource

The number of modules per side.

Data Constructors

version :: Int -> Maybe VersionSource

Valid version number is [1, 40]

Data Types

data Matrix Source

Represents a QR Code symbol.

Instances

data Module Source

The smallest unit in a QR Code symbol (i.e. one square).

Constructors

Dark 
Light 

data Mode Source

Constructors

Numeric
0123456789
Alphanumeric
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-.:.

Input alphabets are automatically converted to upper case.

Instances

data ErrorLevel Source

Constructors

L

Error recovery up to 7%.

M

Error recovery up to 15%.

Q

Error recovery up to 25%.

H

Error recovery up to 30%.