mirror of
https://github.com/openziti/ziti.git
synced 2026-10-23 12:15:35 +00:00
0ec43c5625
Using underscores causes issues with common name fields as they cannot have underscores.
20 lines
330 B
Go
20 lines
330 B
Go
package eid
|
|
|
|
import (
|
|
"github.com/teris-io/shortid"
|
|
"math/rand"
|
|
)
|
|
|
|
const Alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-"
|
|
|
|
var idGenerator *shortid.Shortid
|
|
|
|
func init() {
|
|
idGenerator = shortid.MustNew(0, Alphabet, rand.Uint64())
|
|
}
|
|
|
|
func New() string {
|
|
id, _ := idGenerator.Generate()
|
|
return id
|
|
}
|