mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 23:26:58 +08:00
17 lines
431 B
Go
17 lines
431 B
Go
package signal
|
|
|
|
import "github.com/pion/randutil"
|
|
|
|
// RandSeq generates a random string to serve as dummy data
|
|
//
|
|
// It returns a deterministic sequence of values each time a program is run.
|
|
// Use rand.Seed() function in your real applications.
|
|
func RandSeq(n int) string {
|
|
val, err := randutil.GenerateCryptoRandomString(n, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
return val
|
|
}
|