xorshift7.min.js 988 B

1
  1. !function(a,b,c){function d(a){function b(a,b){var c,d,e=[];if(b===(0|b))d=e[0]=b;else for(b=""+b,c=0;c<b.length;++c)e[7&c]=e[7&c]<<15^b.charCodeAt(c)+e[c+1&7]<<13;for(;e.length<8;)e.push(0);for(c=0;c<8&&0===e[c];++c);for(d=8==c?e[7]=-1:e[c],a.x=e,a.i=0,c=256;c>0;--c)a.next()}var c=this;c.next=function(){var a,b,d=c.x,e=c.i;return a=d[e],a^=a>>>7,b=a^a<<24,a=d[e+1&7],b^=a^a>>>10,a=d[e+3&7],b^=a^a>>>3,a=d[e+4&7],b^=a^a<<7,a=d[e+7&7],a^=a<<13,b^=a^a<<9,d[e]=b,c.i=e+1&7,b},b(c,a)}function e(a,b){return b.x=a.x.slice(),b.i=a.i,b}function f(a,b){null==a&&(a=+new Date);var c=new d(a),f=b&&b.state,g=function(){return(c.next()>>>0)/4294967296};return g.double=function(){do var a=c.next()>>>11,b=(c.next()>>>0)/4294967296,d=(a+b)/(1<<21);while(0===d);return d},g.int32=c.next,g.quick=g,f&&(f.x&&e(f,c),g.state=function(){return e(c,{})}),g}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.xorshift7=f}(this,"object"==typeof module&&module,"function"==typeof define&&define);