Seed chunker with random per-repository polynomial

This commit is contained in:
Alexander Neumann
2015-04-06 00:22:19 +02:00
parent c969a42e8d
commit b2307cafa2
7 changed files with 79 additions and 31 deletions
+6
View File
@@ -10,6 +10,7 @@ import (
"sync"
"github.com/restic/restic/backend"
"github.com/restic/restic/chunker"
"github.com/restic/restic/debug"
)
@@ -26,6 +27,11 @@ func (s *Server) SetKey(k *Key) {
s.key = k
}
// ChunkerPolynomial returns the secret polynomial used for content defined chunking.
func (s *Server) ChunkerPolynomial() chunker.Pol {
return chunker.Pol(s.key.Master().ChunkerPolynomial)
}
// Find loads the list of all blobs of type t and searches for names which start
// with prefix. If none is found, nil and ErrNoIDPrefixFound is returned. If
// more than one is found, nil and ErrMultipleIDMatches is returned.