mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
bitrot: Verify file size inside storage interface (#7932)
This commit is contained in:
@@ -155,3 +155,11 @@ func bitrotWriterSum(w io.Writer) []byte {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Returns the size of the file with bitrot protection
|
||||
func bitrotShardFileSize(size int64, shardSize int64, algo BitrotAlgorithm) int64 {
|
||||
if algo != HighwayHash256S {
|
||||
return size
|
||||
}
|
||||
return ceilFrac(size, shardSize)*int64(algo.New().Size()) + size
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user