summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/request_id.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/request_id.rb b/lib/chef/request_id.rb
index 2c7af01879..d2bc1b42cd 100644
--- a/lib/chef/request_id.rb
+++ b/lib/chef/request_id.rb
@@ -15,7 +15,6 @@
# limitations under the License.
#
-require 'securerandom'
require 'singleton'
class Chef
@@ -31,7 +30,11 @@ class Chef
end
def generate_request_id
- SecureRandom.uuid
+ ary = Random.new.bytes(16).unpack("NnnnnN")
+ ary[2] = (ary[2] & 0x0fff) | 0x4000
+ ary[3] = (ary[3] & 0x3fff) | 0x8000
+ "%08x-%04x-%04x-%04x-%04x%08x" % ary
end
+
end
end