Merge pull request #54 from fkautz/pr_out_exposing_newencoder_since_getencoder_is_no_longer_around

Exposing NewEncoder since GetEncoder is no longer around
master
Harshavardhana 10 years ago
commit 48898d770d
  1. 2
      pkgs/erasure/decode.go
  2. 4
      pkgs/erasure/encode.go

@ -112,6 +112,6 @@ func (e *Encoder) Decode(chunks [][]byte, length int) ([]byte, error) {
}
func Decode(block [][]byte, ep *EncoderParams, length int) ([]byte, error) {
encoder := newEncoder(ep)
encoder := NewEncoder(ep)
return encoder.Decode(block, length)
}

@ -88,7 +88,7 @@ func ParseEncoderParams(k, m, technique int) (*EncoderParams, error) {
}, nil
}
func newEncoder(ep *EncoderParams) *Encoder {
func NewEncoder(ep *EncoderParams) *Encoder {
var k = C.int(ep.k)
var m = C.int(ep.m)
@ -152,6 +152,6 @@ func (e *Encoder) Encode(block []byte) ([][]byte, int) {
}
func Encode(block []byte, ep *EncoderParams) ([][]byte, int) {
encoder := newEncoder(ep)
encoder := NewEncoder(ep)
return encoder.Encode(block)
}

Loading…
Cancel
Save