Files
Sylve/pkg/utils/random.go
T
2025-05-13 22:50:13 +04:00

17 lines
283 B
Go

package utils
import (
"bytes"
"crypto/sha512"
)
func DeterministicEntropy(seed []byte) []byte {
hash := sha512.Sum512(seed)
var entropy bytes.Buffer
for i := 0; i < 1024; i++ {
h := sha512.Sum512(append(hash[:], byte(i)))
entropy.Write(h[:])
}
return entropy.Bytes()
}