Sha256: 26166f62ee2efc09998b402404256cb1bfccf25d53eb3c35a8a6064fef602b2e
Contents?: true
Size: 619 Bytes
Versions: 16
Compression:
Stored size: 619 Bytes
Contents
package jose import ( "bytes" "compress/flate" "io/ioutil" ) func init() { RegisterJwc(new(Deflate)) } // Deflate compression algorithm implementation type Deflate struct {} func (alg *Deflate) Name() string { return DEF } func (alg *Deflate) Compress(plainText []byte) []byte { var buf bytes.Buffer deflate,_ := flate.NewWriter(&buf, 8) //level=DEFLATED deflate.Write(plainText) deflate.Close() return buf.Bytes() } func (alg *Deflate) Decompress(compressedText []byte) []byte { enflated,_ := ioutil.ReadAll( flate.NewReader( bytes.NewReader(compressedText))) return enflated }
Version data entries
16 entries across 16 versions & 1 rubygems