• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.travis.ymlH A D03-Jan-2018377 2423

LICENSEH A D03-Jan-20181.1 KiB2117

README.mdH A D03-Jan-20181.8 KiB6645

codec.goH A D03-Jan-20185.9 KiB207112

codec_test.goH A D03-Jan-20186.9 KiB249182

generator.goH A D03-Jan-20185.9 KiB240148

generator_test.goH A D03-Jan-20183.6 KiB13587

sql.goH A D03-Jan-20182.3 KiB7938

sql_test.goH A D03-Jan-20183.7 KiB13787

uuid.goH A D03-Jan-20184.1 KiB16296

uuid_test.goH A D03-Jan-20183.2 KiB9151

README.md

1# UUID package for Go language
2
3[![Build Status](https://travis-ci.org/satori/go.uuid.png?branch=master)](https://travis-ci.org/satori/go.uuid)
4[![Coverage Status](https://coveralls.io/repos/github/satori/go.uuid/badge.svg?branch=master)](https://coveralls.io/github/satori/go.uuid)
5[![GoDoc](http://godoc.org/github.com/satori/go.uuid?status.png)](http://godoc.org/github.com/satori/go.uuid)
6
7This package provides pure Go implementation of Universally Unique Identifier (UUID). Supported both creation and parsing of UUIDs.
8
9With 100% test coverage and benchmarks out of box.
10
11Supported versions:
12* Version 1, based on timestamp and MAC address (RFC 4122)
13* Version 2, based on timestamp, MAC address and POSIX UID/GID (DCE 1.1)
14* Version 3, based on MD5 hashing (RFC 4122)
15* Version 4, based on random numbers (RFC 4122)
16* Version 5, based on SHA-1 hashing (RFC 4122)
17
18## Installation
19
20Use the `go` command:
21
22	$ go get github.com/satori/go.uuid
23
24## Requirements
25
26UUID package requires Go >= 1.2.
27
28## Example
29
30```go
31package main
32
33import (
34	"fmt"
35	"github.com/satori/go.uuid"
36)
37
38func main() {
39	// Creating UUID Version 4
40	u1 := uuid.NewV4()
41	fmt.Printf("UUIDv4: %s\n", u1)
42
43	// Parsing UUID from string input
44	u2, err := uuid.FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
45	if err != nil {
46		fmt.Printf("Something gone wrong: %s", err)
47	}
48	fmt.Printf("Successfully parsed: %s", u2)
49}
50```
51
52## Documentation
53
54[Documentation](http://godoc.org/github.com/satori/go.uuid) is hosted at GoDoc project.
55
56## Links
57* [RFC 4122](http://tools.ietf.org/html/rfc4122)
58* [DCE 1.1: Authentication and Security Services](http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01)
59
60## Copyright
61
62Copyright (C) 2013-2018 by Maxim Bublis <b@codemonkey.ru>.
63
64UUID package released under MIT License.
65See [LICENSE](https://github.com/satori/go.uuid/blob/master/LICENSE) for details.
66