1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

update rdoc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-04-26 15:47:24 +00:00
parent d0a4f8ada9
commit ebd2090d29

View file

@ -230,7 +230,11 @@ module SecureRandom
# p SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594" # p SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
# p SecureRandom.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b" # p SecureRandom.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b"
# #
# See RFC 4122 for UUID. # The version 4 UUID is purely random (except the version).
# It doesn't contain meaningful information such as MAC address, time, etc.
#
# See RFC 4122 for details of UUID.
#
def self.uuid def self.uuid
ary = self.random_bytes(16).unpack("NnnnnN") ary = self.random_bytes(16).unpack("NnnnnN")
ary[2] = (ary[2] & 0x0fff) | 0x4000 ary[2] = (ary[2] & 0x0fff) | 0x4000