mirror of
https://github.com/donl/gPanel.git
synced 2026-05-26 14:22:18 -06:00
19 lines
332 B
Go
19 lines
332 B
Go
// Encryption package has functions inside of it that utilize various encypting and hashing techniques
|
|
package encryption
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"fmt"
|
|
)
|
|
|
|
func RandomString() (string, error) {
|
|
n := 5
|
|
b := make([]byte, n)
|
|
|
|
if _, err := rand.Read(b); err != nil {
|
|
return "", err
|
|
}
|
|
|
|
s := fmt.Sprintf("%X", b)
|
|
return s, nil
|
|
}
|