Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Generate UUID V4s without allocating.

License

NotificationsYou must be signed in to change notification settings

bentranter/uuid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Generate UUID v4s without any allocations.

Usage

(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}

Benchmark

go test -bench=. -benchmemBenchmarkGenerate-4    1000000      2083 ns/op       0 B/op       0 allocs/opPASSok  github.com/bentranter/uuid2.119s

License

Apache 2. See the LICENSE file for a copy.

About

Generate UUID V4s without allocating.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp