Files
sing-box-extended/common/xray/crypto/crypto.go
Sergei Maklagin 287fe834db Update XHTTP
2025-12-11 02:46:57 +03:00

18 lines
266 B
Go

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