Skip to content

Instantly share code, notes, and snippets.

@utamori
Created July 10, 2020 03:01
Show Gist options
  • Select an option

  • Save utamori/acc99ce93ed8d9d43a4a5983455be672 to your computer and use it in GitHub Desktop.

Select an option

Save utamori/acc99ce93ed8d9d43a4a5983455be672 to your computer and use it in GitHub Desktop.
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