Sha256: 9ec3ec048fe47d6ce0ce06062309926dbac350510e977dda2eab2c11383c4a58

Contents?: true

Size: 253 Bytes

Versions: 48

Compression:

Stored size: 253 Bytes

Contents

module SecureRandom
  def self.uuid
    "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".gsub /[xy]/ do |ch,|
      %x{
        var r = Math.random() * 16 | 0,
            v = ch == "x" ? r : (r & 3 | 8);

        return v.toString(16);
      }
    end
  end
end

Version data entries

48 entries across 48 versions & 3 rubygems

Version Path
opal-0.10.6 stdlib/securerandom.rb
opal-0.10.6.beta stdlib/securerandom.rb
opal-0.10.5 stdlib/securerandom.rb
opal-0.10.4 stdlib/securerandom.rb
opal-0.11.0.rc1 stdlib/securerandom.rb
opal-0.10.3 stdlib/securerandom.rb
opal-0.10.2 stdlib/securerandom.rb
opal-0.10.1 stdlib/securerandom.rb
opal-0.10.0 stdlib/securerandom.rb
opal-0.10.0.rc2 stdlib/securerandom.rb
opal-0.9.4 stdlib/securerandom.rb
opal-0.9.3 stdlib/securerandom.rb
opal-0.10.0.rc1 stdlib/securerandom.rb
opal-0.10.0.beta5 stdlib/securerandom.rb
opal-0.10.0.beta4 stdlib/securerandom.rb
opal-0.10.0.beta3 stdlib/securerandom.rb
opal-0.10.0.beta2 stdlib/securerandom.rb
opal-0.10.0.beta1 stdlib/securerandom.rb
opal-0.9.2 stdlib/securerandom.rb
opal-0.9.0 stdlib/securerandom.rb