Skip to content

A Go library that generates unique identifiers (uuid, version 4) - and nothing else at all.

License

Notifications You must be signed in to change notification settings

charles-m-knox/go-uuid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uuid4

My own minimalist Go library that generates uuid's that implement v4, variant 10.

Securely uses crypto/rand for random number generation.

Using this library instead of typical uuid libraries (that package other uuid versions/features) can reduce a compiled binary size by as much as 7% according to my experiments.

Usage

First, get it:

go get -v github.com/charles-m-knox/go-uuid

Now, in a main.go file:

package main

import (
    "log"

    uuid "github.com/charles-m-knox/go-uuid"
)

func main() {
    u := uuid.New() // generates the uuid
    log.Println(u)  // prints the uuid to console
}

You can also check out uuid_test.go to see the unit tests.

About

A Go library that generates unique identifiers (uuid, version 4) - and nothing else at all.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages