Created
July 10, 2020 03:01
-
-
Save utamori/acc99ce93ed8d9d43a4a5983455be672 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "math/big" | |
| "strings" | |
| "github.com/google/uuid" | |
| ) | |
| func getUUID() string { | |
| u, err := uuid.NewRandom() | |
| if err != nil { | |
| fmt.Println(err) | |
| return "error" | |
| } | |
| var uu big.Int | |
| uu.SetString(strings.Replace(u.String(), "-", "", 4), 16) | |
| uuid := uu.String() | |
| return uuid | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment