Sha256: d041013327fa44a54cf64c8288402c18e3ccf89cf33cbf5924083ba55b22c509

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

//>>built
define("dojox/math/random/Secure",["dojo"],function(_1){
_1.declare("dojox.math.random.Secure",null,{constructor:function(_2,_3){
this.prng=_2;
var p=this.pool=new Array(_2.size);
this.pptr=0;
for(var i=0,_4=_2.size;i<_4;){
var t=Math.floor(65536*Math.random());
p[i++]=t>>>8;
p[i++]=t&255;
}
this.seedTime();
if(!_3){
this.h=[_1.connect(_1.body(),"onclick",this,"seedTime"),_1.connect(_1.body(),"onkeypress",this,"seedTime")];
}
},destroy:function(){
if(this.h){
_1.forEach(this.h,_1.disconnect);
}
},nextBytes:function(_5){
var _6=this.state;
if(!_6){
this.seedTime();
_6=this.state=this.prng();
_6.init(this.pool);
for(var p=this.pool,i=0,_7=p.length;i<_7;p[i++]=0){
}
this.pptr=0;
}
for(var i=0,_7=_5.length;i<_7;++i){
_5[i]=_6.next();
}
},seedTime:function(){
this._seed_int(new Date().getTime());
},_seed_int:function(x){
var p=this.pool,i=this.pptr;
p[i++]^=x&255;
p[i++]^=(x>>8)&255;
p[i++]^=(x>>16)&255;
p[i++]^=(x>>24)&255;
if(i>=this.prng.size){
i-=this.prng.size;
}
this.pptr=i;
}});
return dojox.math.random.Secure;
});

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
dojox-rails-0.14.0 vendor/assets/javascripts/dojox/math/random/Secure.js
dojox-rails-0.13.0 vendor/assets/javascripts/dojox/math/random/Secure.js
dojox-rails-0.12.0 vendor/assets/javascripts/dojox/math/random/Secure.js
dojox-rails-0.11.0 vendor/assets/javascripts/math/random/Secure.js
dojo-rails-0.9.4 vendor/assets/javascripts/dojox/math/random/Secure.js
dojo-rails-0.9.3 vendor/assets/javascripts/dojox/math/random/Secure.js
dojo-rails-0.9.2 vendor/assets/javascripts/dojox/math/random/Secure.js
dojo-rails-0.9.1 vendor/assets/javascripts/dojox/math/random/Secure.js
dojo-rails-0.9.0 vendor/assets/javascripts/dojox/math/random/Secure.js