uuid

package module
Version: v0.0.0-...-d0d07a5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2017 License: MIT Imports: 2 Imported by: 0

README

uuid

Go Report Card Codecov Build Status Go docs

go get 4d63.com/uuid
import 4d63.com/uuid

Package uuid exports typing for UUIDs. Sub-packages export functions for generating UUIDs of different types.

Documentation

See the godoc.

Documentation

Overview

Package uuid exports typing for UUIDs. Sub-packages export functions for generating UUIDs of different types.

Example
package main

import (
	"fmt"

	"4d63.com/uuid"
)

func main() {
	id, _ := uuid.Parse("08827178-0ad4-11e7-b5df-b3f54921aa61")

	fmt.Println("String:", id.String())
	fmt.Println("Timestamp:", id.Timestamp())

}
Output:

String: 08827178-0ad4-11e7-b5df-b3f54921aa61
Timestamp: 1290011724057047416

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UUID

type UUID [16]byte

UUID is an implementation of the UUID RFC4122 standard. Ref: https://www.ietf.org/rfc/rfc4122.txt

func New

func New(b [16]byte) UUID

New creates a UUID from a [16]byte.

func Parse

func Parse(s string) (UUID, error)

Parse parses the hyphenated UUID string for a UUID.

func (UUID) String

func (id UUID) String() string

String returns a text hyphenated hexadecimal representation of the UUID.

func (UUID) Timestamp

func (id UUID) Timestamp() int64

Timestamp returns the integer value of the time portion of the UUID in 100ns intervals since Oct 15, 1582.

Note: All UUIDs have a time bits, but only TimeUUIDs (UUID v1) contain the time in these bits, making the return value of this function relatively useless for other UUIDs.

Source Files

Directories

Path Synopsis
Package uuidv1 exports functions for creating version 1 UUIDs, based on the current or a fixed time.
Package uuidv1 exports functions for creating version 1 UUIDs, based on the current or a fixed time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL