Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2024-02-18 00:36:40 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2024-02-18 00:41:43 +0300
commit2b4d6160c40d55cd8e9a7ffad4cc1524c19c4591 (patch)
tree5aea5de12e5cd2582063a521d5d7ec7bd7314b66 /util
parent57029b1a402acd3034723e956c76536f1e1ade66 (diff)
minor changes
Diffstat (limited to 'util')
-rw-r--r--util/random/random.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/util/random/random.go b/util/random/random.go
index b1dd2e09..1dd47ec9 100644
--- a/util/random/random.go
+++ b/util/random/random.go
@@ -2,7 +2,6 @@ package random
import (
"math/rand"
- "time"
)
var numSeq [10]rune
@@ -13,8 +12,6 @@ var numUpperSeq [36]rune
var allSeq [62]rune
func init() {
- rand.Seed(time.Now().UnixNano())
-
for i := 0; i < 10; i++ {
numSeq[i] = rune('0' + i)
}
@@ -41,3 +38,7 @@ func Seq(n int) string {
}
return string(runes)
}
+
+func Num(n int) int {
+ return rand.Intn(n)
+}