adhoc-network-1.0.3: Ad-hoc P2P network protocolSource codeContentsIndex
Network.AdHoc.MessageID
MaintainerStephan Friedrichs, Henning Guenther
Description
Synopsis
type MessageID = String
type MessageIDGenerator g = g -> [MessageID]
counter :: MessageIDGenerator g
scrambler :: RandomGen g => Int -> MessageIDGenerator g
hasher :: RandomGen g => MessageIDGenerator g
Documentation
type MessageID = StringSource
This is just a String.
type MessageIDGenerator g = g -> [MessageID]Source
Generate an infinite(!) stream of MessageIDs.
counter :: MessageIDGenerator gSource
Simplest possible generator type: counts from 0 upwards. Very insecure.
scrambler :: RandomGen g => Int -> MessageIDGenerator gSource
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 :: RandomGen g => MessageIDGenerator gSource
Generates a stream of IDs by hashing an up-counting number and a random number with SHA512.
Produced by Haddock version 2.6.1