bufPool.go 167 B

1234567891011
  1. package tools
  2. import (
  3. "bytes"
  4. "crypto/rand"
  5. "io"
  6. )
  7. func AppendRandBytes(b *bytes.Buffer, length int) {
  8. b.ReadFrom(io.LimitReader(rand.Reader, int64(length)))
  9. }