ContentsIndex
Network.AdHoc.MessageID
MaintainerStephan Friedrichs, Henning Guenther
Description
Synopsis
type MessageID = String
type MessageIDGenerator = RandomGen g => g -> [MessageID]
counter :: MessageIDGenerator
scrambler :: Int -> MessageIDGenerator
hasher :: MessageIDGenerator
Documentation
type MessageID = String
This is just a String.
type MessageIDGenerator = RandomGen g => g -> [MessageID]
Generate an infinite(!) stream of MessageIDs.
counter :: MessageIDGenerator
Simplest possible generator type: counts from 0 upwards. Very insecure.
scrambler :: Int -> MessageIDGenerator
Generates a stream of MessageIDs by shuffling a sorted stream couting from 0 upwards ([0..]). scrambler n g would randomly remove the i-th element (where i is a random number between 0 and n) from the sorted list and place it at the head of the result list. It deals with the following elements in the same way.
hasher :: MessageIDGenerator
Generates a stream of IDs by hashing an up-counting number and a random number with SHA512.
Produced by Haddock version 0.8