Merge pull request #849 from dmcgowan/remove-stringid

Replace stringid call with simple random reader
This commit is contained in:
Lantao Liu
2018-07-12 18:32:28 -07:00
committed by GitHub
5 changed files with 19 additions and 102 deletions

View File

@@ -16,9 +16,14 @@ limitations under the License.
package util
import "github.com/docker/docker/pkg/stringid"
import (
"encoding/hex"
"math/rand"
)
// GenerateID generates a random unique id.
func GenerateID() string {
return stringid.GenerateNonCryptoID()
b := make([]byte, 32)
rand.Read(b)
return hex.EncodeToString(b)
}