Files
163a34c676 Move More To Common (#414)
* move more to common

* more moves

* move random

---------

Co-authored-by: yacovm <[email protected]>
2026-06-18 17:58:56 +02:00

14 lines
266 B
Go

package common
import (
"encoding/binary"
"math/rand/v2"
)
func NewRandomSourceFromSeed(seed int64) *rand.Rand {
var seedBytes [32]byte
binary.LittleEndian.PutUint64(seedBytes[:8], uint64(seed))
chacha := rand.NewChaCha8(seedBytes)
return rand.New(chacha)
}