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

Safe HaskellNone
LanguageHaskell2010

Data.QRCodes.Image

Contents

Description

A few functions to deal with the image itself

Synopsis

Functions to convert to JuicyPixels Image

bsToImg :: ByteString -> IO (Image Word8) Source #

Create a JuicyPixels Image from a ByteString

objToImg :: ToJSON a => a -> IO (Image Word8) Source #

Encode an object as a JuicyPixels Image

Functions to sign and convert to Image

bsToImgSec :: ByteString -> FilePath -> IO (Image Word8) Source #

Creates a signed QR code from a strict bytestring and path to keyfile/path where the keyfile should be generated, yielding a JuicyPixels Image. Note that QR codes may only contain a small number of characters, so encrypting can sometimes make an object too big to encode.

bsToImgSec (BS.pack "hello") ".key.hk"

objToImgSec :: ToJSON a => a -> FilePath -> IO (Image Word8) Source #

Encode an object as a JuicyPixels Image with a key in a given file.

Functions to sign with user-supplied key and yield an Image

bsToImgSec' :: ByteString -> (PublicKey, PrivateKey) -> IO (Image Word8) Source #

Sign a byteString with a given key

bsToImgSec' (BS.pack "str") (generate 256 0x10001)

objToImgSec' :: ToJSON a => a -> (PublicKey, PrivateKey) -> IO (Image Word8) Source #

Encode an object as a JuicyPixels Image with a key.