first commit
This commit is contained in:
15
pkg/tools/id/id.go
Normal file
15
pkg/tools/id/id.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package id
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
)
|
||||
|
||||
func New() string {
|
||||
bytes := make([]byte, 24)
|
||||
_, err := rand.Read(bytes)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return hex.EncodeToString(bytes)
|
||||
}
|
||||
Reference in New Issue
Block a user