1
0
mirror of https://github.com/google/uuid.git synced 2025-09-16 09:16:30 +02:00

Add NewString Func (#73)

* added utility func

* updated docs & function call
This commit is contained in:
jackterm
2021-01-22 13:20:15 -05:00
committed by GitHub
parent b5d0d36c98
commit bfb86fa49a

View File

@@ -14,6 +14,14 @@ func New() UUID {
return Must(NewRandom())
}
// NewString creates a new random UUID and returns it as a string or panics.
// NewString is equivalent to the expression
//
// uuid.New().String()
func NewString() string {
return Must(NewRandom()).String()
}
// NewRandom returns a Random (Version 4) UUID.
//
// The strength of the UUIDs is based on the strength of the crypto/rand