Examples: Make examples/util internal

Resolves #424
This commit is contained in:
backkem
2019-02-20 20:42:19 +01:00
committed by Michiel De Backker
parent bf422e0c0a
commit ddcef2d84f
24 changed files with 542 additions and 247 deletions

View File

@@ -0,0 +1,17 @@
package signal
import (
"math/rand"
"time"
)
// RandSeq generates a random string to serve as dummy data
func RandSeq(n int) string {
r := rand.New(rand.NewSource(time.Now().UnixNano()))
letters := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
b := make([]rune, n)
for i := range b {
b[i] = letters[r.Intn(len(letters))]
}
return string(b)
}