kpango / fuid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fuid License: MIT release CircleCI codecov Codacy Badge Go Report Card GolangCI Go Walker GoDoc DepShield Badge

fuid is simple and fast uuid string library forked from rs/xid

Requirement

Go 1.11

Installation

go get github.com/kpango/fuid

Example

	fuid.String()

Benchmarks

fuid vs rs/xid vs satori/go.uuid vs google/uuid

go test -count=5 -run=NONE -bench . -benchmem
goos: darwin
goarch: amd64
pkg: github.com/kpango/fuid
BenchmarkFUID-8         	50000000	        34.5 ns/op	      32 B/op	       1 allocs/op
BenchmarkFUID-8         	50000000	        35.6 ns/op	      32 B/op	       1 allocs/op
BenchmarkFUID-8         	50000000	        35.0 ns/op	      32 B/op	       1 allocs/op
BenchmarkFUID-8         	50000000	        37.2 ns/op	      32 B/op	       1 allocs/op
BenchmarkFUID-8         	50000000	        36.8 ns/op	      32 B/op	       1 allocs/op
BenchmarkXID-8          	30000000	        50.4 ns/op	      32 B/op	       1 allocs/op
BenchmarkXID-8          	30000000	        51.9 ns/op	      32 B/op	       1 allocs/op
BenchmarkXID-8          	30000000	        53.4 ns/op	      32 B/op	       1 allocs/op
BenchmarkXID-8          	30000000	        49.0 ns/op	      32 B/op	       1 allocs/op
BenchmarkXID-8          	30000000	        49.4 ns/op	      32 B/op	       1 allocs/op
BenchmarkSatoriUUID-8   	 3000000	       609 ns/op	      20 B/op	       1 allocs/op
BenchmarkSatoriUUID-8   	 3000000	       594 ns/op	      19 B/op	       1 allocs/op
BenchmarkSatoriUUID-8   	 2000000	       574 ns/op	      20 B/op	       1 allocs/op
BenchmarkSatoriUUID-8   	 3000000	       593 ns/op	      20 B/op	       1 allocs/op
BenchmarkSatoriUUID-8   	 2000000	       613 ns/op	      20 B/op	       1 allocs/op
BenchmarkGoogleUUID-8   	 3000000	       561 ns/op	      20 B/op	       1 allocs/op
BenchmarkGoogleUUID-8   	 3000000	       588 ns/op	      19 B/op	       1 allocs/op
BenchmarkGoogleUUID-8   	 3000000	       590 ns/op	      19 B/op	       1 allocs/op
BenchmarkGoogleUUID-8   	 2000000	       590 ns/op	      19 B/op	       1 allocs/op
BenchmarkGoogleUUID-8   	 3000000	       575 ns/op	      19 B/op	       1 allocs/op
PASS
ok  	github.com/kpango/fuid	39.718s

Contribution

  1. Fork it ( https://github.com/kpango/fuid/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author

kpango

LICENSE

fuid released under MIT license, refer LICENSE file.

About

License:MIT License


Languages

Language:Go 77.3%Language:Makefile 22.7%