function to generate random text

This commit is contained in:
2025-10-31 21:30:48 -03:00
parent 05af0969e9
commit b15d847fd2

13
pkg/packet.lua.d/rand.go Normal file
View File

@@ -0,0 +1,13 @@
package packet
import "math/rand"
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$%!@%&*()-=+[]{}:;.,1234567890"
func randStringBytes(n int) string {
b := make([]byte, n)
for i := range b {
b[i] = letterBytes[rand.Intn(len(letterBytes))]
}
return string(b)
}