summaryrefslogtreecommitdiff
blob: 4eb15348456aba8808b90e73103644e0965ebb7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Index: uuidtools-1.0.7/lib/uuidtools.rb
===================================================================
--- uuidtools-1.0.7.orig/lib/uuidtools.rb
+++ uuidtools-1.0.7/lib/uuidtools.rb
@@ -191,10 +191,7 @@ class UUID
           octet.to_i(16)
         end
       else
-        nodes = SecureRandom.random_bytes(6).split("").map do |chr|
-          # Ruby 1.9 / Ruby 1.8
-          chr.respond_to?(:ord) ? chr.ord : chr.sum(8)
-        end
+        nodes = SecureRandom.random_bytes(6).unpack("C*")
         nodes[0] |= 0b00000001
       end
       for i in 0..5