Documentation ¶
Index ¶
- func CreateCUID() string
- func CreateGUID() string
- func CreateRawULID() ulid.ULID
- func CreateSlug() string
- func CreateTSID() string
- func CreateTXID() string
- func CreateULID() string
- func CreateUUID() string
- func CreateXUID() string
- func RandomBytes(size int) ([]byte, error)
- func Version() string
- type Counter
- type DefaultCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTSID ¶
func CreateTSID() string
CreateTSID generates a 12 character time-stamp / base 36 id
func CreateTXID ¶
func CreateTXID() string
CreateTXID generates a 16 character time-stamp / base 36 id
func CreateXUID ¶
func CreateXUID() string
CreateXUID generates a 25 character cuid that starts with a random lowercase character
func RandomBytes ¶
RandomBytes generates a byte buffer of the specified size and populates it with crypo-strength random bytes
Types ¶
type Counter ¶
type Counter interface {
Next() int32
}
Counter interface default counter implementation
type DefaultCounter ¶
type DefaultCounter struct {
// contains filtered or unexported fields
}
DefaultCounter specific to cuid's
func (*DefaultCounter) Next ¶
func (c *DefaultCounter) Next() int32
Next generate the next counter value
Click to show internal directories.
Click to hide internal directories.