fountain-0.0.0: A fountain codec.

Codec.Fountain

Description

Fountain codes are forward error correction codes for erasure channels. They are able to recover lost packets without needed a backchannel. As a rateless code, transmitters generate packets at random, on the fly. Receivers then listen to as many packets as needed to reconstruct the message.

Synopsis

Documentation

data Droplet a Source

A message droplet is a set of message indices and the combined symbol.

Constructors

Droplet IntSet a 

Instances

Eq a => Eq (Droplet a) 
Show a => Show (Droplet a) 

data Decoder a Source

A decoder holds the state of the decoding process.

droplets :: Bits a => Int -> Int -> [a] -> [Droplet a]Source

An infinite list of droplets, given a seed, the max degree, and a message. Only the xor method of Bits is used.

decoder :: Int -> Decoder aSource

Creates a new decoder given a message length.

decode :: Bits a => Decoder a -> Droplet a -> Either (Decoder a) [a]Source

Given a Decoder and a new Droplet, returns either an updated Decoder or the decoded message. Only the xor method of Bits is used.

test :: Int -> Int -> Int -> IO IntSource

Runs a test of a Word8 message given a seed, message length, and droplet max degree. Returns the number of droplets that were needed to decode the message.