21 lines
281 B
Go
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[:]
|
||
|
}
|