mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
🔒️ more secure token generation
This commit is contained in:
@@ -39,3 +39,14 @@ func TestNotification(t *testing.T) {
|
||||
assert.Equal(t, IPDesensitize(c.input), c.output)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenerGenerateRandomString(t *testing.T) {
|
||||
generatedString := make(map[string]bool)
|
||||
for i := 0; i < 100; i++ {
|
||||
str, err := GenerateRandomString(32)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, len(str), 32)
|
||||
assert.False(t, generatedString[str])
|
||||
generatedString[str] = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user