Documentation
¶
Overview ¶
A unique identifier generator that is high performance, very fast, and tries to be entropy pool friendly.
Index ¶
Constants ¶
const Version = "1.0.1"
Version of the library
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NUID ¶
type NUID struct {
// contains filtered or unexported fields
}
func New ¶
func New() *NUID
New will generate a new NUID and properly initialize the prefix, sequential start, and sequential increment.
func (*NUID) RandomizePrefix ¶
func (n *NUID) RandomizePrefix()
Generate a new prefix from crypto/rand. This call *can* drain entropy and will be called automatically when we exhaust the sequential range. Will panic if it gets an error from rand.Int()
