client

package
v0.0.0-...-7790e94 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2014 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(in io.Reader) io.Reader

func DeFountain

func DeFountain(blocks []Block, signature string, dynamic bool) io.Reader

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 Decompress

func Decompress(in io.Reader) io.Reader

func Decrypt

func Decrypt(in io.Reader, key string) io.Reader

func DirWalk

func DirWalk(dirPath string) []string

func Encrypt

func Encrypt(in io.Reader, key string) io.Reader

func Join

func Join(filedir string) io.Reader

Takes a list of 'files' and joins them back together according to it's order

func Split

func Split(file io.Reader, block_size int, filename string) string

Splits a 'file' into blocks of size 'block_size' and outputs them into The directory given by 'filedir'

func ValidateFlags

func ValidateFlags(flags []string) bool

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

func Fountain(src io.Reader, dist int, size int, perc float32, signature string) []Block

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

func ValidateBlocks(blocks []Block, signature string) []Block

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL