diff --git a/pkg/packet.lua.d/rand.go b/pkg/packet.lua.d/rand.go new file mode 100644 index 0000000..61200ee --- /dev/null +++ b/pkg/packet.lua.d/rand.go @@ -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) +}