Class: EventMachine::RTMP::UUID

Inherits:
Object
  • Object
show all
Defined in:
lib/em-rtmp/uuid.rb

Class Method Summary collapse

Class Method Details

.rand_hex_3(l) ⇒ Object



8
9
10
# File 'lib/em-rtmp/uuid.rb', line 8

def self.rand_hex_3(l)
  "%0#{l}x" % rand(1 << l*4)
end

.randomObject



4
5
6
# File 'lib/em-rtmp/uuid.rb', line 4

def self.random
  [8,4,4,4,12].map {|n| rand_hex_3(n)}.join('-').to_s.upcase
end