Documentation ¶
Index ¶
- func Compress(in io.Reader) io.Reader
- func DeFountain(blocks []Block, signature string, dynamic bool) io.Reader
- func Decompress(in io.Reader) io.Reader
- func Decrypt(in io.Reader, key string) io.Reader
- func DirWalk(dirPath string) []string
- func Encrypt(in io.Reader, key string) io.Reader
- func Join(filedir string) io.Reader
- func Split(file io.Reader, block_size int, filename string) string
- func ValidateFlags(flags []string) bool
- type Block
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeFountain ¶
DeFountain takes a []Block of valid blocks (validated by ValidateBlocks) and recompiles the blocks into the source file as an io.Reader. It optionally allows for dynamic reconstruction that has a higher success rate, but can increase overall runtime.
func Split ¶
Splits a 'file' into blocks of size 'block_size' and outputs them into The directory given by 'filedir'
func ValidateFlags ¶
Types ¶
type Block ¶
type Block struct { Id string // unique Id of block Parents []string // slice of parent chunks Data string // encoded source data Hash string // signed content hash }
func Fountain ¶
Fountain takes an io.Reader from a source file and implements a Luby Transform fountain code encoding algorithm over the file. It uses degree of distribution, chunk size, and a percent of chunks to generate into blocks.
func ValidateBlocks ¶
ValidateBlocks takes a []Block of remotely pulled blocks from the network and compares it to a block chain generated list. Returns an empty list if all blocks are valid, or a []Block of corrupt blocks otherwise.