file-store/pkg/erasureencode/util.go
2022-08-23 21:56:32 -05:00

21 lines
281 B
Go

package erasureencode
import (
"crypto/sha256"
)
func min(input ...uint64) uint64 {
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[:]
}