2021-02-15 14:32:03 +08:00
|
|
|
package tools
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
2021-09-20 21:02:18 +08:00
|
|
|
"crypto/rand"
|
|
|
|
"io"
|
2021-02-15 14:32:03 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func AppendRandBytes(b *bytes.Buffer, length int) {
|
2021-09-20 21:02:18 +08:00
|
|
|
b.ReadFrom(io.LimitReader(rand.Reader, int64(length)))
|
2021-02-15 14:32:03 +08:00
|
|
|
}
|