File tree 3 files changed +7
-4
lines changed
3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 5
5
require (
6
6
github.com/libgox/addr v0.2.0
7
7
github.com/libgox/gocollections v0.0.0-20241024144716-59fe0afe6953
8
+ github.com/libgox/unicodex v0.0.1
8
9
github.com/prometheus/client_golang v1.20.5
9
10
github.com/stretchr/testify v1.9.0
10
11
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ github.com/libgox/addr v0.2.0 h1:he4Vv7lzcGy/1qNpjJufEWRql0S23Ki/j0XpTDMDu3s=
16
16
github.com/libgox/addr v0.2.0 /go.mod h1:j0hEfpRqTZy4BsstS9Egsn1U0JmNdj/VkbF2VBmJlFw =
17
17
github.com/libgox/gocollections v0.0.0-20241024144716-59fe0afe6953 h1:qnlK5i5xCbMjQLqFa6JfNn3r7mtRMwMtuqJjyhgAYK8 =
18
18
github.com/libgox/gocollections v0.0.0-20241024144716-59fe0afe6953 /go.mod h1:Y4udpR8lStv1f67hVWbMCrcTyTvf98bFFsu/ZXvAvZ0 =
19
+ github.com/libgox/unicodex v0.0.1 h1:yUuZWMVXC5N9dcYgIc3aO7+2M5jN+XVatrU08Y5fC4k =
20
+ github.com/libgox/unicodex v0.0.1 /go.mod h1:RaB9wNp/oOS0Ew5+Wml7WePjztZ3njXiNid08KOmgjs =
19
21
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA =
20
22
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 /go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ =
21
23
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
Original file line number Diff line number Diff line change @@ -17,21 +17,21 @@ package opengemini
17
17
import (
18
18
"crypto/rand"
19
19
"math/big"
20
- )
21
20
22
- const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
21
+ "github.com/libgox/unicodex/letter"
22
+ )
23
23
24
24
func RandBytes (n int64 ) []byte {
25
25
if n <= 0 {
26
26
return []byte {}
27
27
}
28
28
b := make ([]byte , n )
29
29
for i := range b {
30
- index , err := rand .Int (rand .Reader , big .NewInt (int64 (len ( letters ) )))
30
+ index , err := rand .Int (rand .Reader , big .NewInt (int64 (letter . EnglishCount )))
31
31
if err != nil {
32
32
panic (err )
33
33
}
34
- b [i ] = letters [index .Int64 ()]
34
+ b [i ] = letter . EnglishLetters [index .Int64 ()]
35
35
}
36
36
return b
37
37
}
You can’t perform that action at this time.
0 commit comments