From eceb58fff59065bb57ac1b71190b649c4bc25c50 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Tue, 9 Aug 2016 17:00:16 -0700 Subject: [PATCH] Updates hashicorp/go-uuid. --- vendor/github.com/hashicorp/go-uuid/README.md | 4 ++-- vendor/github.com/hashicorp/go-uuid/uuid.go | 16 ++++++++++++---- vendor/vendor.json | 4 +++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/vendor/github.com/hashicorp/go-uuid/README.md b/vendor/github.com/hashicorp/go-uuid/README.md index 21fdda4ad..02565c8c4 100644 --- a/vendor/github.com/hashicorp/go-uuid/README.md +++ b/vendor/github.com/hashicorp/go-uuid/README.md @@ -1,6 +1,6 @@ -# uuid +# uuid [![Build Status](https://travis-ci.org/hashicorp/go-uuid.svg?branch=master)](https://travis-ci.org/hashicorp/go-uuid) -Generates UUID-format strings using purely high quality random bytes. +Generates UUID-format strings using high quality, purely random bytes. It can also parse UUID-format strings into their component bytes. Documentation ============= diff --git a/vendor/github.com/hashicorp/go-uuid/uuid.go b/vendor/github.com/hashicorp/go-uuid/uuid.go index 322b522c2..ff9364c40 100644 --- a/vendor/github.com/hashicorp/go-uuid/uuid.go +++ b/vendor/github.com/hashicorp/go-uuid/uuid.go @@ -6,13 +6,21 @@ import ( "fmt" ) +// GenerateRandomBytes is used to generate random bytes of given size. +func GenerateRandomBytes(size int) ([]byte, error) { + buf := make([]byte, size) + if _, err := rand.Read(buf); err != nil { + return nil, fmt.Errorf("failed to read random bytes: %v", err) + } + return buf, nil +} + // GenerateUUID is used to generate a random UUID func GenerateUUID() (string, error) { - buf := make([]byte, 16) - if _, err := rand.Read(buf); err != nil { - return "", fmt.Errorf("failed to read random bytes: %v", err) + buf, err := GenerateRandomBytes(16) + if err != nil { + return "", err } - return FormatUUID(buf) } diff --git a/vendor/vendor.json b/vendor/vendor.json index 583565e18..a543b9294 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -254,8 +254,10 @@ "revisionTime": "2015-02-18T18:19:46Z" }, { + "checksumSHA1": "mAkPa/RLuIwN53GbwIEMATexams=", "path": "github.com/hashicorp/go-uuid", - "revision": "36289988d83ca270bc07c234c36f364b0dd9c9a7" + "revision": "64130c7a86d732268a38cb04cfbaf0cc987fda98", + "revisionTime": "2016-07-17T02:21:40Z" }, { "checksumSHA1": "d9PxF1XQGLMJZRct2R8qVM/eYlE=",