19 lines
297 B
Go
19 lines
297 B
Go
package models
|
|
|
|
import (
|
|
randomutil "git.maronato.dev/maronato/goshort/internal/util/random"
|
|
)
|
|
|
|
const (
|
|
// IDLength is the length of IDs.
|
|
IDLength = 16
|
|
)
|
|
|
|
func NewID() string {
|
|
return randomutil.GenerateSecureToken(IDLength)
|
|
}
|
|
|
|
func LooksLikeID(id string) bool {
|
|
return len(id) == IDLength
|
|
}
|