init
This commit is contained in:
76 files changed
+22739
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package identifier
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
)
|
||||
|
||||
func New(prefix string) string {
|
||||
var b [12]byte
|
||||
if _, err := rand.Read(b[:]); err != nil {
|
||||
panic("domainops: secure random source unavailable: " + err.Error())
|
||||
}
|
||||
return prefix + "_" + hex.EncodeToString(b[:])
|
||||
}
|
||||
Reference in new issue
Block a user