An open API service indexing awesome lists of open source software.

https://github.com/bsm/go-guid

MongoDB style globally unique identifiers in Go
https://github.com/bsm/go-guid

go golang guid unique-id

Last synced: about 1 year ago
JSON representation

MongoDB style globally unique identifiers in Go

Awesome Lists containing this project

README

          

# GUID

[![Build Status](https://travis-ci.org/bsm/go-guid.png?branch=master)](https://travis-ci.org/bsm/go-guid)
[![GoDoc](https://godoc.org/github.com/bsm/go-guid?status.png)](http://godoc.org/github.com/bsm/go-guid)
[![Go Report Card](https://goreportcard.com/badge/github.com/bsm/go-guid)](https://goreportcard.com/report/github.com/bsm/go-guid)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Simple, thread-safe MongoDB style GUID generator.

### Examples

```go
func main {
// Create a new 12-byte globally-unique identifier
id := guid.New96()
fmt.Println(hex.EncodeToString(id.Bytes()))
}
```

```go
func main {
// Create a new 16-byte globally-unique identifier
id := guid.New128()
fmt.Println(hex.EncodeToString(id.Bytes()))
}
```