2019-12-28 09:48:36 +01:00
|
|
|
package session
|
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/rand"
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2020-06-25 14:54:04 +02:00
|
|
|
func NewID() string {
|
2019-12-28 09:48:36 +01:00
|
|
|
b := make([]byte, 24)
|
|
|
|
|
|
|
|
if _, err := rand.Read(b); err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf("%x", b)
|
|
|
|
}
|