Collision-resistant hashes for the cloud, in Go
Go
Latest commit 25c102a Sep 25, 2015 @lucsky Current version is 1.0.1
Permalink
Failed to load latest commit information.
.gitignore Initial commit Aug 1, 2014
LICENSE Initial commit Aug 1, 2014
README.md Current version is 1.0.1 Sep 25, 2015
cuid.go Fixed data races. Sep 25, 2015
cuid_test.go Fixed data races. Sep 25, 2015

README.md

cuid

Collision-resistant hashes for the cloud, in Go.

The `cuid package provides collision-resistant ids optimized for horizontal scaling and sequential lookup performance. This README file is just going to cover the basics and the Go-specific implementation details.

Please refer to the main project site for the full rationale behind CUIDs.

Sample CUID

ch72gsb320000udocl363eofy

Installation

HEAD:

go get github.com/lucsky/cuid

v1.0.1:

go get gopkg.in/lucsky/cuid.v1

Example usage

package main

import fmt
import "gopkg.in/lucsky/cuid.v1"

func main() {
    fmt.Println(cuid.New())
}

Go package specific features

The Go cuid package provides APIs to specify a custom random source as well as a custom counter. A custom counter implementation could provide a centralized Redis base counter, for example.

Contributors

  • Luc Heinrich (lucsky, author)
  • Thomas Hopkins (hopkinsth)