snap-1.1.3.2: Top-level package for the Snap Web Framework

Safe Haskell | Safe-Inferred
Language | Haskell2010

Snap.Snaplet.Session.Common

Description

This module contains functionality common among multiple back-ends.

Synopsis

- data RNG
- mkRNG :: IO RNG
- withRNG :: RNG -> (GenIO -> IO a) -> IO a
- randomToken :: Int -> RNG -> IO ByteString
- mkCSRFToken :: RNG -> IO Text

# Documentation

data RNG Source #

High speed, mutable random number generator state

mkRNG :: IO RNG Source #

Create a new RNG

withRNG :: RNG -> (GenIO -> IO a) -> IO a Source #

Perform given action, mutating the RNG state

randomToken :: Int -> RNG -> IO ByteString Source #

Generates a random salt of given length

mkCSRFToken :: RNG -> IO Text Source #

Generate a randomized CSRF token