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.7.0.beta1 stdlib/securerandom.rb
opal-0.6.2 stdlib/securerandom.rb
opal-0.6.1 stdlib/securerandom.rb
opal-0.6.0 stdlib/securerandom.rb
opal-0.5.5 stdlib/securerandom.rb
opal-0.5.4 stdlib/securerandom.rb
opal-0.5.2 stdlib/securerandom.rb
opal-0.5.0 stdlib/securerandom.rb