Sha256: 0bc0128e2fe55f7270c3eef1ce02b2c3c4063b4024d9abcaadb4d09b743a6ec1

Contents?: true

Size: 254 Bytes

Versions: 7

Compression:

Stored size: 254 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

7 entries across 7 versions & 1 rubygems

Version Path
opal-1.0.5 stdlib/securerandom.rb
opal-1.0.4 stdlib/securerandom.rb
opal-1.0.3 stdlib/securerandom.rb
opal-1.0.2 stdlib/securerandom.rb
opal-1.0.1 stdlib/securerandom.rb
opal-1.0.0 stdlib/securerandom.rb
opal-1.0.0.beta1 stdlib/securerandom.rb