github.com/searKing/golang/go@v1.2.117/crypto/rand/bytes.go (about)

     1  // Copyright 2020 The searKing Author. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package rand
     6  
     7  // Bytes returns securely generated random bytes.
     8  func Bytes(n int) []byte {
     9  	b, err := BytesCrypto(n)
    10  	if err == nil {
    11  		return b
    12  	}
    13  	return BytesMath(n)
    14  }