Upstream sync

This commit is contained in:
Senad Uka
2023-10-24 05:48:19 +02:00
parent 2c267b71e4
commit fd880aeaa2
8 changed files with 83 additions and 77 deletions

View File

@@ -12,6 +12,15 @@ import (
"io"
)
func GenerateRandomString(length int) string {
b := make([]byte, length)
_, err := rand.Read(b)
if err != nil {
panic(err)
}
return base64.StdEncoding.EncodeToString(b)
}
func CovertUintToByte32(id uint) [32]byte {
b := make([]byte, 32)
binary.LittleEndian.PutUint32(b, uint32(id))