shortuuid

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetRand

func SetRand(seed int64)

SetRand sets the random number generator to seed.

Types

type ShortUUID

type ShortUUID uuid.UUID

ShortUUID is a type that can stringify a UUID without hyphens.

func New

func New() ShortUUID

New constructs a ShortUUID object.

func (ShortUUID) String

func (u ShortUUID) String() string
Example
package main

import (
	"fmt"

	"github.com/inklabs/rangedb/pkg/shortuuid"
)

func main() {
	// Given
	shortuuid.SetRand(101)
	u := shortuuid.New()

	// When
	fmt.Println(u.String())

}
Output:

b03b2442c5de4e58b6c62e8094847f3d

Jump to

Keyboard shortcuts

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