forked from TrueCloudLab/restic
mem: use cheaper hash for backend
This commit is contained in:
parent
c3400d3c55
commit
28e1c4574b
1 changed files with 2 additions and 2 deletions
|
@ -3,13 +3,13 @@ package mem
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"crypto/md5"
|
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"hash"
|
"hash"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/cespare/xxhash/v2"
|
||||||
"github.com/restic/restic/internal/backend"
|
"github.com/restic/restic/internal/backend"
|
||||||
"github.com/restic/restic/internal/backend/sema"
|
"github.com/restic/restic/internal/backend/sema"
|
||||||
"github.com/restic/restic/internal/debug"
|
"github.com/restic/restic/internal/debug"
|
||||||
|
@ -266,7 +266,7 @@ func (be *MemoryBackend) Location() string {
|
||||||
|
|
||||||
// Hasher may return a hash function for calculating a content hash for the backend
|
// Hasher may return a hash function for calculating a content hash for the backend
|
||||||
func (be *MemoryBackend) Hasher() hash.Hash {
|
func (be *MemoryBackend) Hasher() hash.Hash {
|
||||||
return md5.New()
|
return xxhash.New()
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasAtomicReplace returns whether Save() can atomically replace files
|
// HasAtomicReplace returns whether Save() can atomically replace files
|
||||||
|
|
Loading…
Reference in a new issue