|
|
@ -52,11 +52,11 @@ func ETagChunks(chunks []*filer_pb.FileChunk) (etag string) { |
|
|
|
if len(chunks) == 1 { |
|
|
|
return fmt.Sprintf("%x", util.Base64Md5ToBytes(chunks[0].ETag)) |
|
|
|
} |
|
|
|
md5_digests := [][]byte{} |
|
|
|
var md5Digests [][]byte |
|
|
|
for _, c := range chunks { |
|
|
|
md5_digests = append(md5_digests, util.Base64Md5ToBytes(c.ETag)) |
|
|
|
md5Digests = append(md5Digests, util.Base64Md5ToBytes(c.ETag)) |
|
|
|
} |
|
|
|
return fmt.Sprintf("%x-%d", util.Md5(bytes.Join(md5_digests, nil)), len(chunks)) |
|
|
|
return fmt.Sprintf("%x-%d", util.Md5(bytes.Join(md5Digests, nil)), len(chunks)) |
|
|
|
} |
|
|
|
|
|
|
|
func CompactFileChunks(lookupFileIdFn wdclient.LookupFileIdFunctionType, chunks []*filer_pb.FileChunk) (compacted, garbage []*filer_pb.FileChunk) { |
|
|
|