21 lines
279 B
Go
21 lines
279 B
Go
package erasureencode
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
)
|
|
|
|
func min(input ...int64) int64 {
|
|
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[:]
|
|
}
|