2018-04-20 11:26:54 +00:00
|
|
|
package dedup
|
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/rand"
|
|
|
|
|
2018-09-25 07:05:38 +00:00
|
|
|
whisper "github.com/status-im/whisper/whisperv6"
|
2018-04-20 11:26:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func generateMessages(count int) []*whisper.Message {
|
|
|
|
result := []*whisper.Message{}
|
|
|
|
for ; count > 0; count-- {
|
|
|
|
content := mustGenerateRandomBytes()
|
|
|
|
result = append(result, &whisper.Message{Payload: content})
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
func mustGenerateRandomBytes() []byte {
|
|
|
|
c := 2048
|
|
|
|
b := make([]byte, c)
|
|
|
|
_, err := rand.Read(b)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return b
|
|
|
|
}
|