qr-imager-2.0.0.2: Library to generate images.

Safe HaskellNone
LanguageHaskell2010

Data.QRCodes

Contents

Description

Module providing several functions for creating QR codes and their signed counterparts

Synopsis

Functions on objects

createQRCode :: Binary a => a -> FilePath -> IO () Source #

Creates a QR code from an object that is part of the ToJSON class

createQRCode userRecord "user-231.png"

createSecureQRCode :: Binary a => a -> FilePath -> FilePath -> IO () Source #

Creates a signed QR code from an object that is part of the ToJSON class

createSecureQRCode' :: Binary a => a -> (PublicKey, PrivateKey) -> FilePath -> IO () Source #

Creates a signed QR code from an object that is part of the ToJSON class

Functions for ByteStrings

byteStringToQR :: ByteString -> FilePath -> IO () Source #

Create a QR code, writing an image to the given FilePath

functions to read QR codes

readQRString :: FilePath -> IO String Source #

given a filepath, read the QR code as a string in all lowercase

readQRString "picture.jpg"

readQRStrSec :: Binary a => FilePath -> FilePath -> IO a Source #

given a filepath pointing to a QR code, get the contents & verify signature with the keyfile

readQRStrSec "output.png" ".key.hk"

readQRStrSec' :: Binary a => FilePath -> (PublicKey, PrivateKey) -> IO a Source #

Read an image containing a QR code, decode and verify the signature using the given key.