Files
sing-box-extended/common/xray/crypto/crypto.go
2025-06-08 19:35:59 +03:00

15 lines
225 B
Go

package crypto
import (
"crypto/rand"
"math/big"
)
func RandBetween(from int64, to int64) int64 {
if from == to {
return from
}
bigInt, _ := rand.Int(rand.Reader, big.NewInt(to-from))
return from + bigInt.Int64()
}