Documentation ¶
Overview ¶
Package id provides types and functions for generation of identifiers.
Index ¶
Constants ¶
View Source
const Size = 20
Size is the size of an ID.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
ID is a codeable unique identifier.
func Unique ¶
func Unique() ID
Unique returns a unique identifier by hashing the current time and machine hostname.
func (ID) MarshalJSON ¶
MarshalJSON encodes the ID as a JSON string.
func (*ID) Parse ¶
Parse parses lowercase string s as a 20 byte hex-encoded ID, or copies s to the ID if it is 20 bytes long.
func (*ID) UnmarshalJSON ¶
UnmarshalJSON decodes a JSON string as an ID.
Click to show internal directories.
Click to hide internal directories.