ethstats-server/web-app/.meteor/local/build/programs/server/packages/random.js.map

1 line
9.1 KiB
Plaintext
Raw Normal View History

2015-08-14 19:22:53 +02:00
{"version":3,"sources":["random/random.js","random/deprecated.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gF;AACA,2E;AACA,4E;AACA,6E;AACA,2E;AACA,2E;AACA,gF;AACA,gC;;AAEA,oB;AACA,yC;;AAEA,qE;AACA,iD;AACA,wB;AACA,mB;AACA,uB;;AAEA,+B;AACA,6B;AACA,6C;AACA,gC;AACA,wC;AACA,oB;AACA,e;AACA,e;AACA,oB;AACA,e;AACA,qC;AACA,O;AACA,yD;AACA,M;;AAEA,8B;AACA,gB;AACA,G;;AAEA,2B;AACA,e;AACA,e;AACA,e;AACA,c;;AAEA,2B;AACA,yB;AACA,K;AACA,sB;AACA,mB;AACA,mB;AACA,mB;;AAEA,2C;AACA,0B;AACA,mB;AACA,gB;AACA,O;AACA,0B;AACA,mB;AACA,gB;AACA,O;AACA,0B;AACA,mB;AACA,gB;AACA,O;AACA,K;AACA,gB;;AAEA,6B;AACA,iE;AACA,c;AACA,c;AACA,kC;AACA,M;AACA,gC;AACA,4C;AACA,M;AACA,iC;AACA,uB;AACA,oE;AACA,M;AACA,gC;AACA,uB;AACA,kB;;AAEA,6C;AACA,E;;AAEA,mF;AACA,2E;AACA,iB;;AAEA,8E;AACA,0E;AACA,6E;AACA,yC;AACA,4C;AACA,kB;AACA,8B;AACA,4C;AACA,E;;AAEA,kD;AACA,kB;AACA,kB;AACA,uB;AACA,0B;AACA,oD;AACA,uD;AACA,8D;AACA,6C;AACA,mC;AACA,yC;AACA,sD;AACA,U;AACA,qD;AACA,G;AACA,E;;AAEA,yD;AACA,kB;AACA,kC;AACA,yC;AACA,c;AACA,mE;AACA,qD;AACA,S;AACA,+C;AACA,iB;AACA,kE;AACA,qD;AACA,K;AACA,uC;AACA,2E;AACA,wD;AACA,uC;AACA,U;AACA,uB;AACA,sC;AACA,sD;AACA,K;AACA,8B;AACA,G;AACA,E;;AAEA,+D;AACA,+D;AACA,kB;AACA,kB;AACA,wC;AACA,sC;AACA,G;AACA,yB;AACA,E;;AAEA,sD;AACA,kB;AACA,uE;AACA,4B;AACA,+B;AACA,oB;;AAEA,4D;AACA,E;;AAEA,0D;AACA,kB;AACA,mE;AACA,e;AACA,+B;AACA,oB;AACA,sD;AACA,E;;AAEA,6D;AACA,iE;AACA,wC;AACA,0C;AACA,M;AACA,gC;AACA,E;;AAEA,8E;AACA,sC;;AAEA,iB;AACA,qE;AACA,sC;AACA,kC;AACA,mD;AACA,sC;AACA,uB;AACA,wC;AACA,Q;;AAEA,mE;AACA,sC;AACA,kC;AACA,kD;AACA,sC;AACA,uB;AACA,uC;AACA,Q;;AAEA,4E;;AAEA,iB;AACA,qC;AACA,qD;AACA,iC;AACA,I;AACA,kF;;AAEA,sC;AACA,+B;AACA,8C;AACA,G;AACA,wC;AACA,E;;;;;;;;;;;;;;;;;;;ACzNA,iE;AACA,gE;AACA,oB;AACA,wB;AACA,2B;AACA,sC;AACA,a;AACA,gC;AACA,qC;AACA,G;AACA,c;AACA,iE;AACA,qC;;AAEA,wB;AACA,c;AACA,E","file":"/packages/random.js","sourcesContent":["// We use cryptographically strong PRNGs (crypto.getRandomBytes() on the server,\n// window.crypto.getRandomValues() in the browser) when available. If these\n// PRNGs fail, we fall back to the Alea PRNG, which is not cryptographically\n// strong, and we seed it with various sources such as the date, Math.random,\n// and window size on the client. When using crypto.getRandomValues(), our\n// primitive is hexString(), from which we construct fraction(). When using\n// window.crypto.getRandomValues() or alea, the primitive is fraction and we use\n// that to construct hex string.\n\nif (Meteor.isServer)\n var nodeCrypto = Npm.require('crypto');\n\n// see http://baagoe.org/en/wiki/Better_random_numbers_for_javascript\n// for a full discussion and Alea implementation.\nvar Alea = function () {\n function Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n mash.version = 'Mash 0.9';\n return mash;\n }\n\n return (function (args) {\n var s0 = 0;\n var s1 = 0;\n var s2 = 0;\n var c = 1;\n\n if (args.length == 0) {\n args = [+new Date];\n }\n var mash = Mash();\n s0 = mash(' ');\n s1 = mash(' ');\n s2 = mash(' ');\n\n for (var i = 0; i < args.length; i++) {\n s0 -= mash(args[i]);\n if (s0 < 0) {\n s0 += 1;\n }\n s1 -= mash(args[i]);\n if (s1 < 0) {\n s1 += 1;\n }\n s2 -= mash(args[i]);\n if (s2 < 0) {\n s2 += 1;\n }\n }\n mash = null;\n\n var random = function() {\n var t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32\n s0 = s1;\n s1 = s2;\n return s2 = t - (c = t | 0);\n };\n random.uint32 = function() {\n return random() * 0x100000000; // 2^32\n };\n random.fract53 = function() {\n return random() +\n (random() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n ran