mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-23 12:49:51 +03:00
15 lines
225 B
Go
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()
|
|
}
|