go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/types/uuid.go (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  package types
     5  
     6  import (
     7  	"encoding/base64"
     8  
     9  	"github.com/gofrs/uuid"
    10  )
    11  
    12  // UUID generates a new string encoded UUID
    13  func UUID() string {
    14  	b := uuid.Must(uuid.NewV4()).Bytes()
    15  	return base64.StdEncoding.EncodeToString(b)
    16  }