qr-imager-1.0.1.1: Library to generate QR codes from bytestrings and objects

Safe HaskellNone
LanguageHaskell2010

Data.QRCodes

Contents

Description

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

Synopsis

Functions on objects

createQRCode :: ToJSON 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 :: ToJSON a => a -> FilePath -> FilePath -> IO () Source #

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

createSecureQRCode' :: ToJSON 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 #

Creates a QR code from a strict bytestring

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 :: FromJSON 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' :: FromJSON a => FilePath -> (PublicKey, PrivateKey) -> IO a Source #

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