uidc

package
v1.115.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package uidc provides functions to generate simple time-and-random-based unique identifiers.

It offers functions to generate 64-bit and 128-bit random identifiers in base-36 string format.

The generated IDs are not intended for cryptographic or security-related purposes. Instead, they serve as simple unique identifiers for various use cases.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewID128

func NewID128() string

NewID128 returns a 128-bit unique identifier encoded as a base-36 string. The high 64 bits are derived from the current time; the low 64 bits are random.

Example
package main

import (
	"fmt"

	"github.com/tecnickcom/gogen/pkg/uidc"
)

func main() {
	v := uidc.NewID128()

	fmt.Println(v)
}

func NewID64

func NewID64() string

NewID64 returns a 64-bit unique ID encoded as a base-36 string. The upper 32 bits contain a timestamp and the lower 32 bits are random. The timestamp epoch is January 1st of the current decade's starting year.

Example
package main

import (
	"fmt"

	"github.com/tecnickcom/gogen/pkg/uidc"
)

func main() {
	v := uidc.NewID64()

	fmt.Println(v)
}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL