/yyid.go

Almost a random UUID in Go

Primary LanguageGoMIT LicenseMIT

YYID

Generates random tokens that look like type 4 UUIDs: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

In contrast to RFC 4122, it uses all digits (128bit)

Source of randomness: crypto/rand

Install

Add dependency to your go file:

import (
  "github.com/janlelis/yyid.go"
)

Then install with:

$ go install

Usage

yyid.New() // => "b4d254ec-198e-dbca-2ca3-bd3551180b50"

Also Available