mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
Improve compression speed
Use Huffman compression in order to fasten the compression speed as described in https://golang.org/pkg/compress/flate/#NewWriter
This commit is contained in:
parent
50a64d04da
commit
20497437fe
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ import (
|
||||||
// Compress returns a compressed byte slice.
|
// Compress returns a compressed byte slice.
|
||||||
func Compress(src []byte) []byte {
|
func Compress(src []byte) []byte {
|
||||||
compressedData := new(bytes.Buffer)
|
compressedData := new(bytes.Buffer)
|
||||||
compress(src, compressedData, 9)
|
compress(src, compressedData, -2)
|
||||||
return compressedData.Bytes()
|
return compressedData.Bytes()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue