Skip to content

Commit

Permalink
Add NewString Func (#73)
Browse files Browse the repository at this point in the history
* added utility func

* updated docs & function call
  • Loading branch information
jackterm committed Jan 22, 2021
1 parent b5d0d36 commit bfb86fa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions version4.go
Expand Up @@ -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
Expand Down

0 comments on commit bfb86fa

Please sign in to comment.