rs

package
v0.0.0-...-12667e7 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunk

func Chunk(params Params, data []byte) ([][]byte, int, error)

Function that chunks the data into 1 shard of [][]byte and pads uneven shards with 0x00, shardSize is automatically calculated

func Decode

func Decode(params Params, data [][]byte) ([]byte, error)

Decode the data using reedsolomon

func DecodeOnlyData

func DecodeOnlyData(params Params, data [][]byte) ([]byte, error)

func DeflateBlocks

func DeflateBlocks(data [][]byte) []byte

Function that goes over [][]byte and returns []byte

func Encode

func Encode(params Params, chunks [][]byte) ([][]byte, error)

Function which encodes the data using reedsolomon

func InflateBlocks

func InflateBlocks(data []byte, chunkSize int) [][]byte

Function that goes over []byte and returns [][]byte splitting by chunkSize

Types

type Params

type Params struct {
	DataShards   int
	ParityShards int
	ChunkSize    int
}

Jump to

Keyboard shortcuts

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