v.io: v.io/v23/uniqueid Index | Files

package uniqueid

import "v.io/v23/uniqueid"

Package uniqueid defines functions that are likely to generate globally unique identifiers. We want to be able to generate many Ids quickly, so we make a time/space tradeoff. We reuse the same random data many times with a counter appended. Note: these Ids are NOT useful as a security mechanism as they will be predictable.

nolint:golint

Index

Package Files

uniqueid.go uniqueid.vdl.go

func Valid Uses

func Valid(id Id) bool

Valid returns true if the given Id is valid.

type Id Uses

type Id [16]byte

An Id is a likely globally unique identifier.

func FromHexString Uses

func FromHexString(s string) (Id, error)

func Random Uses

func Random() (Id, error)

Random produces a new probably unique identifier using the RandomGenerator.

func (Id) String Uses

func (id Id) String() string

func (Id) VDLIsZero Uses

func (x Id) VDLIsZero() bool

func (*Id) VDLRead Uses

func (x *Id) VDLRead(dec vdl.Decoder) error

func (Id) VDLReflect Uses

func (Id) VDLReflect(struct {
    Name string `vdl:"v.io/v23/uniqueid.Id"`
})

func (Id) VDLWrite Uses

func (x Id) VDLWrite(enc vdl.Encoder) error

type RandomGenerator Uses

type RandomGenerator struct {
    // contains filtered or unexported fields
}

A RandomGenerator can generate random Ids. The zero value of RandomGenerator is ready to use.

func (*RandomGenerator) NewID Uses

func (g *RandomGenerator) NewID() (Id, error)

NewId produces a new probably unique identifier.

Package uniqueid imports 6 packages (graph) and is imported by 45 packages. Updated 2020-10-24. Refresh now. Tools for package owners.