You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.5 KiB
48 lines
1.5 KiB
10 years ago
|
// Package erasure is a Go wrapper for the Intel Intelligent Storage
|
||
|
// Acceleration Library (Intel ISA-L). Intel ISA-L is a CPU optimized
|
||
|
// implementation of erasure code.
|
||
|
//
|
||
|
// For more information on Intel ISA-L, please visit:
|
||
|
// https://01.org/intel%C2%AE-storage-acceleration-library-open-source-version
|
||
|
//
|
||
|
// Usage
|
||
|
//
|
||
|
// TODO: Explain Encode and Decode inputs and outputs
|
||
|
//
|
||
|
// TODO: Explain matrix size and how it corresponds to protection level
|
||
|
//
|
||
|
// Encoding data may be performed in 3 steps.
|
||
|
//
|
||
10 years ago
|
// 1. Create a parse set of encoder parameters
|
||
10 years ago
|
// 2. Create a new encoder
|
||
|
// 3. Encode data
|
||
|
//
|
||
|
// Decoding data is also performed in 3 steps.
|
||
|
//
|
||
10 years ago
|
// 1. Create a parse set of encoder parameters for validation
|
||
10 years ago
|
// 2. Create a new encoder
|
||
|
// 3. Decode data
|
||
|
//
|
||
|
// Encoder parameters contain four configurable elements:
|
||
10 years ago
|
// ParseEncoderParams(k, m, technique int) (EncoderParams, error)
|
||
10 years ago
|
// k - Number of rows in matrix
|
||
|
// m - Number of colums in matrix
|
||
|
// technique - Matrix type, can be either CAUCHY (recommended) or VANDERMONDE
|
||
10 years ago
|
// constraints: k + m < Galois Field (2^8)
|
||
10 years ago
|
//
|
||
|
// Example
|
||
|
//
|
||
|
// Creating and using an encoder
|
||
|
// var bytes []byte
|
||
10 years ago
|
// params := erasure.ParseEncoderParams(10, 5, erasure.CAUCHY)
|
||
10 years ago
|
// encoder := erasure.NewEncoder(params)
|
||
|
// encodedData, length := encoder.Encode(bytes)
|
||
|
//
|
||
|
// Creating and using a decoder
|
||
|
// var encodedData [][]byte
|
||
|
// var length int
|
||
10 years ago
|
// params := erasure.ParseEncoderParams(10, 5, erasure.CAUCHY)
|
||
10 years ago
|
// encoder := erasure.NewEncoder(params)
|
||
|
// originalData, err := encoder.Decode(encodedData, length)
|
||
|
package erasure
|