- Notifications
You must be signed in to change notification settings - Fork0
Generate UUID V4s without allocating.
License
NotificationsYou must be signed in to change notification settings
bentranter/uuid
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Generate UUID v4s without any allocations.
(Don't actually use this, usehttps://github.com/satori/go.uuid instead, it's much better)
package mainimport ("fmt""github.com/bentranter/uuid")funcmain() {x:=uuid.V4()y:=uuid.V4()fmt.Println(string(x[:]))fmt.Println(string(y[:]))// Output (example):// ee416737-4a97-49aa-a3e9-b6fce0bb757a// 51033a45-4a43-4551-848b-e6f246541652}
go test -bench=. -benchmemBenchmarkGenerate-4 1000000 2083 ns/op 0 B/op 0 allocs/opPASSok github.com/bentranter/uuid2.119s
Apache 2. See the LICENSE file for a copy.