using uuid golang
package main import ( "fmt" "strings" "github.com/google/uuid" ) func main() { uuidWithHyphen := uuid.New() fmt.Println(uuidWithHyphen) uuid := strings.Replace(uuidWithHyphen.String(), "-", "", -1) fmt.Println(uuid) }
using uuid golang
package main import ( "fmt" "strings" "github.com/google/uuid" ) func main() { uuidWithHyphen := uuid.New() fmt.Println(uuidWithHyphen) uuid := strings.Replace(uuidWithHyphen.String(), "-", "", -1) fmt.Println(uuid) }
golang generate uuid
package main import ( "fmt" "crypto/rand" "log" ) func main() { b := make([]byte, 16) _, err := rand.Read(b) if err != nil { log.Fatal(err) } uuid := fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) fmt.Println(uuid) }
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us