This commit is contained in:
2022-01-07 20:04:12 +02:00
commit fb547b549c
10 changed files with 586 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
//
package pmtools
import (
"encoding/hex"
"time"
"math/rand"
)
func RandBytesHex(size int) string {
rand.Seed(time.Now().UnixNano())
randBytes := make([]byte, size)
rand.Read(randBytes)
hexString := hex.EncodeToString(randBytes)
return hexString
}
func RandBytes(size int) []byte {
rand.Seed(time.Now().UnixNano())
randBytes := make([]byte, size)
rand.Read(randBytes)
return randBytes
}
//EOF