Add NewString Func (#73)
* added utility func
* updated docs & function call
diff --git a/version4.go b/version4.go
index c110465..86160fb 100644
--- a/version4.go
+++ b/version4.go
@@ -14,6 +14,14 @@
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