file-store/pkg/erasureencode/util.go

21 lines
279 B
Go
Raw Normal View History

2022-08-24 02:54:01 +00:00
package erasureencode
import (
"crypto/sha256"
)
func min(input ...int64) int64 {
2022-08-24 02:54:01 +00:00
min := input[0]
for i := 1; i < len(input); i++ {
if input[i] < min {
min = input[i]
}
}
return min
}
func sha256sum(input []byte) []byte {
v := sha256.Sum256(input)
return v[:]
}