github.com/selefra/selefra-utils@v0.0.4/pkg/id_util/id_util.go (about)

     1  package id_util
     2  
     3  import "strings"
     4  import uuid2 "github.com/satori/go.uuid"
     5  
     6  // RandomUUID A UUID V4 string is randomly generated
     7  func RandomUUID() string {
     8  	return uuid2.NewV4().String()
     9  }
    10  
    11  // RandomId Generates a globally unique 32-bit character ID, which is essentially a UUID without the - sign
    12  func RandomId() string {
    13  	return strings.ReplaceAll(uuid2.NewV4().String(), "-", "")
    14  }