aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--const.go13
-rw-r--r--repo.go4
2 files changed, 10 insertions, 7 deletions
diff --git a/const.go b/const.go
index 700d3df..c97578c 100644
--- a/const.go
+++ b/const.go
@@ -3,9 +3,12 @@ package main
// Defined as var to prevent from using them as const as I want to keep
// beeing able to change tkem at runtime.
var (
- chunkSize = 8 << 10
- chunksName = "chunks"
- chunkIdFmt = "%015d"
- versionFmt = "%05d"
- filesName = "files"
+ chunkSize = 8 << 10
+ chunksName = "chunks"
+ chunkIdFmt = "%015d"
+ versionFmt = "%05d"
+ filesName = "files"
+ sketchWSize = 32
+ sketchSfCount = 3
+ sketchFCount = 4
)
diff --git a/repo.go b/repo.go
index a898f36..a505859 100644
--- a/repo.go
+++ b/repo.go
@@ -221,7 +221,7 @@ func hashChunks(chunks <-chan StoredChunk) (FingerprintMap, SketchMap) {
io.Copy(hasher, c.Reader())
h := hasher.Sum64()
fingerprints[h] = c.Id()
- sketch, _ := SketchChunk(c, 32, 3, 4)
+ sketch, _ := SketchChunk(c, sketchWSize, sketchSfCount, sketchFCount)
for _, s := range sketch {
prev := sketches[s]
if contains(prev, c.Id()) {
@@ -246,7 +246,7 @@ func findSimilarChunk(chunk Chunk, sketches SketchMap) (*ChunkId, bool) {
var similarChunks = make(map[ChunkId]int)
var max int
var similarChunk *ChunkId
- sketch, _ := SketchChunk(chunk, 32, 3, 4)
+ sketch, _ := SketchChunk(chunk, sketchWSize, sketchSfCount, sketchFCount)
for _, s := range sketch {
chunkIds, exists := sketches[s]
if !exists {