2022-03-12 18:06:39 +00:00
|
|
|
// package rand
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// import (
|
|
|
|
// "crypto/rand"
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// "git.technical.kiwi/go/otfe/misc/b64"
|
|
|
|
// )
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// //Bytes generates an random set of bytes n long
|
|
|
|
// func Bytes(n int) ([]byte, error) {
|
|
|
|
// b := make([]byte, n)
|
|
|
|
// _, err := rand.Read(b)
|
|
|
|
// return b, err
|
|
|
|
// }
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// //B64String generates a base 64 string n bytess long
|
|
|
|
// func B64String(n int) (string, error) {
|
|
|
|
// b, err := Bytes(n)
|
|
|
|
// return b64.Encode(string(b)), err
|
|
|
|
// }
|