1 // Copyright 2011 Google Inc. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 import guuid "github.com/google/uuid"
9 // Random returns a Random (Version 4) UUID or panics.
11 // The strength of the UUIDs is based on the strength of the crypto/rand
14 // A note about uniqueness derived from the UUID Wikipedia entry:
16 // Randomly generated UUIDs have 122 random bits. One's annual risk of being
17 // hit by a meteorite is estimated to be one chance in 17 billion, that
18 // means the probability is about 0.00000000006 (6 × 10−11),
19 // equivalent to the odds of creating a few tens of trillions of UUIDs in a
20 // year and having one duplicate.
21 func NewRandom() UUID {
22 if gu, err := guuid.NewRandom(); err == nil {