Change compression level to BestSpeed and use sha1 instead of sha256
This commit is contained in:
parent
09826fc7ad
commit
08bcb31b9e
|
@ -28,7 +28,7 @@ func (a *Archive) Create(dst string, ctx context.Context) (os.FileInfo, error) {
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
gzw := gzip.NewWriter(f)
|
gzw, _ := gzip.NewWriterLevel(f, gzip.BestSpeed)
|
||||||
defer gzw.Flush()
|
defer gzw.Flush()
|
||||||
defer gzw.Close()
|
defer gzw.Close()
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package backup
|
package backup
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/sha256"
|
"crypto/sha1"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"github.com/apex/log"
|
"github.com/apex/log"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
@ -93,7 +93,7 @@ func (b *Backup) Size() (int64, error) {
|
||||||
|
|
||||||
// Returns the SHA256 checksum of a backup.
|
// Returns the SHA256 checksum of a backup.
|
||||||
func (b *Backup) Checksum() ([]byte, error) {
|
func (b *Backup) Checksum() ([]byte, error) {
|
||||||
h := sha256.New()
|
h := sha1.New()
|
||||||
|
|
||||||
f, err := os.Open(b.Path())
|
f, err := os.Open(b.Path())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user