Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.
/ go-uuid-v4 Public archive

Small package implementing UUIDv4 in go with a few basic functions

License

Notifications You must be signed in to change notification settings

FossoresLP/go-uuid-v4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A new package supporting all UUID versions from 1 trough 8 has been released at FossoresLP/uuid and supersedes this package.

Go UUIDv4

CircleCI Coveralls Codacy Licensed under: Boost Software License GoDoc

This package contains a minimal implementation of UUIDv4 in Go.

Consider using either Google's implementation or this one by Gofrs if you need additional features.

This package can only generate version 4 UUIDs as defined in RFC 4122

Create a new UUID: uuid.New() (UUID, error)

Convert an UUID to a string: UUID.String() string

Do both in one step: uuid.NewString() (string, error)

Convert a string to an UUID: uuid.Parse(string) (UUID, error)

Convert a byte slice to an UUID: uuid.ParseBytes([]byte) (UUID, error)

Check if UUID contains only zeros: UUID.IsEmpty() bool

Both encoding.Text(Un)Marshaler and encoding.Binary(Un)Marshaler are supported to ensure compatibility with databases and data exchange formats.

About

Small package implementing UUIDv4 in go with a few basic functions

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages