summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--pkg/cetus/random.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/cetus/random.go b/pkg/cetus/random.go
new file mode 100644
index 0000000..d77a24b
--- /dev/null
+++ b/pkg/cetus/random.go
@@ -0,0 +1,16 @@
+package cetus
+
+import (
+	"math/rand"
+)
+
+// RandAlNum returns random alpha-numeric string of specific length
+func RandAlNum(n int) string {
+	rand.Seed(time.Now().UnixNano())
+	const alphanum = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+	b := make([]byte, n)
+	for i := range b {
+		b[i] = letterBytes[rand.Intn(len(letterBytes))]
+	}
+	return string(b)
+}
s' href='/runxiyu/www/commit/contact.html?id=8e0ed2be90f5763e49b644406ee707f34f096db0'>8e0ed2b ^
503607d ^
7138747 ^
ec00a69 ^
7138747 ^
4ed4f4c ^
7138747 ^









503607d ^
7138747 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35