rdso

package
v0.0.0-...-fc4b8ed Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileCorrupt = errors.New("File corrupted")
View Source
var ErrSizeIncorrect = errors.New("Provided size didn't match count of bytes read")

Functions

func Check

func Check(r, rsr io.Reader, log *u.Logger) error

Check the integrity of the bytestream from r using an encoding bytestream in rsr that was been generated by Encode().

func Encode

func Encode(r io.ReadSeeker, size int64, w io.Writer, nDataShards, nParityShards, hashRate int) error

Encode Reed-Solomon encodes the bytestream from the io.Reader r and write the result to the provided io.Writer. The number of bytes that will be provided by r must be passed in the size argument.

func Restore

func Restore(r, rsr io.Reader, size int64, w, rsw io.Writer, log *u.Logger) error

Given a bytestream r and its encoding in rsr, attempt to repair any corrupt bytes, returning a repaired bytestream in w and a repaired encoding bytestream in rsw. Returns nil iff recovery was successful.

Types

This section is empty.

Jump to

Keyboard shortcuts

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