whois/template/utils/random_id.go

17 lines
189 B
Go
Raw Normal View History

2025-01-05 19:39:13 -05:00
package utils
import (
"crypto/rand"
"fmt"
)
func RandomId() string {
id := make([]byte, 16)
_, err := rand.Read(id)
if err != nil {
panic(err)
}
return fmt.Sprintf("%x", id)
}