use native js function for siphash
This commit is contained in:
1 parent
11204cba16
commit
6008c94949
3 files changed
+90
-2
No files matched your search
@@ -39,8 +39,7 @@ $packages["runtime/trace"]=(function(){var $pkg={},$init,A,B;A=$packages["io"];B
|
|||||||
$packages["testing"]=(function(){var $pkg={},$init,H,B,C,E,I,D,A,K,L,M,N,J,F,G,P,Q,R,AP,AQ,AR,AS,AT,AU,AV,AW,AX,AY,AZ,BA,BB,BC,BD,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;H=$packages["bytes"];B=$packages["flag"];C=$packages["fmt"];E=$packages["github.com/gopherjs/gopherjs/nosync"];I=$packages["io"];D=$packages["os"];A=$packages["runtime"];K=$packages["runtime/debug"];L=$packages["runtime/pprof"];M=$packages["runtime/trace"];N=$packages["strconv"];J=$packages["strings"];F=$packages["sync/atomic"];G=$packages["time"];$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=H.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=I.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=K.$init();$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=L.$init();$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=M.$init();$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=N.$init();$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=J.$init();$s=12;case 12:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=F.$init();$s=13;case 13:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=G.$init();$s=14;case 14:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}a=B.String("test.bench","","regular expression to select benchmarks to run");$s=15;case 15:if($c){$c=false;a=a.$blk();}if(a&&a.$blk!==undefined){break s;}P=a;b=B.Duration("test.benchtime",new G.Duration(0,1000000000),"approximate run time for each benchmark");$s=16;case 16:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}Q=b;c=B.Bool("test.benchmem",false,"print memory allocations for benchmarks");$s=17;case 17:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}R=c;d=B.Bool("test.short",false,"run smaller test suite to save time");$s=18;case 18:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}AP=d;e=B.String("test.outputdir","","directory in which to write profiles");$s=19;case 19:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}AQ=e;f=B.Bool("test.v",false,"verbose: print additional output");$s=20;case 20:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}AR=f;g=B.Uint("test.count",1,"run tests and benchmarks `n` times");$s=21;case 21:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}AS=g;h=B.String("test.coverprofile","","write a coverage profile to the named file after execution");$s=22;case 22:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}AT=h;i=B.String("test.run","","regular expression to select tests and examples to run");$s=23;case 23:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}AU=i;j=B.String("test.memprofile","","write a memory profile to the named file after execution");$s=24;case 24:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}AV=j;k=B.Int("test.memprofilerate",0,"if >=0, sets runtime.MemProfileRate");$s=25;case 25:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}AW=k;l=B.String("test.cpuprofile","","write a cpu profile to the named file during execution");$s=26;case 26:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}AX=l;m=B.String("test.blockprofile","","write a goroutine blocking profile to the named file after execution");$s=27;case 27:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}AY=m;n=B.Int("test.blockprofilerate",1,"if >= 0, calls runtime.SetBlockProfileRate()");$s=28;case 28:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}AZ=n;o=B.String("test.trace","","write an execution trace to the named file after execution");$s=29;case 29:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}BA=o;p=B.Duration("test.timeout",new G.Duration(0,0),"if positive, sets an aggregate time limit for all tests");$s=30;case 30:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}BB=p;q=B.String("test.cpu","","comma-separated list of number of CPUs to use for each test");$s=31;case 31:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}BC=q;r=B.Int("test.parallel",A.GOMAXPROCS(0),"maximum test parallelism");$s=32;case 32:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}BD=r;}return;}if($f===undefined){$f={$blk:$init};}$f.$s=Line truncated
|
$packages["testing"]=(function(){var $pkg={},$init,H,B,C,E,I,D,A,K,L,M,N,J,F,G,P,Q,R,AP,AQ,AR,AS,AT,AU,AV,AW,AX,AY,AZ,BA,BB,BC,BD,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;H=$packages["bytes"];B=$packages["flag"];C=$packages["fmt"];E=$packages["github.com/gopherjs/gopherjs/nosync"];I=$packages["io"];D=$packages["os"];A=$packages["runtime"];K=$packages["runtime/debug"];L=$packages["runtime/pprof"];M=$packages["runtime/trace"];N=$packages["strconv"];J=$packages["strings"];F=$packages["sync/atomic"];G=$packages["time"];$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=H.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=I.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=K.$init();$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=L.$init();$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=M.$init();$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=N.$init();$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=J.$init();$s=12;case 12:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=F.$init();$s=13;case 13:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=G.$init();$s=14;case 14:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}a=B.String("test.bench","","regular expression to select benchmarks to run");$s=15;case 15:if($c){$c=false;a=a.$blk();}if(a&&a.$blk!==undefined){break s;}P=a;b=B.Duration("test.benchtime",new G.Duration(0,1000000000),"approximate run time for each benchmark");$s=16;case 16:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}Q=b;c=B.Bool("test.benchmem",false,"print memory allocations for benchmarks");$s=17;case 17:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}R=c;d=B.Bool("test.short",false,"run smaller test suite to save time");$s=18;case 18:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}AP=d;e=B.String("test.outputdir","","directory in which to write profiles");$s=19;case 19:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}AQ=e;f=B.Bool("test.v",false,"verbose: print additional output");$s=20;case 20:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}AR=f;g=B.Uint("test.count",1,"run tests and benchmarks `n` times");$s=21;case 21:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}AS=g;h=B.String("test.coverprofile","","write a coverage profile to the named file after execution");$s=22;case 22:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}AT=h;i=B.String("test.run","","regular expression to select tests and examples to run");$s=23;case 23:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}AU=i;j=B.String("test.memprofile","","write a memory profile to the named file after execution");$s=24;case 24:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}AV=j;k=B.Int("test.memprofilerate",0,"if >=0, sets runtime.MemProfileRate");$s=25;case 25:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}AW=k;l=B.String("test.cpuprofile","","write a cpu profile to the named file during execution");$s=26;case 26:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}AX=l;m=B.String("test.blockprofile","","write a goroutine blocking profile to the named file after execution");$s=27;case 27:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}AY=m;n=B.Int("test.blockprofilerate",1,"if >= 0, calls runtime.SetBlockProfileRate()");$s=28;case 28:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}AZ=n;o=B.String("test.trace","","write an execution trace to the named file after execution");$s=29;case 29:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}BA=o;p=B.Duration("test.timeout",new G.Duration(0,0),"if positive, sets an aggregate time limit for all tests");$s=30;case 30:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}BB=p;q=B.String("test.cpu","","comma-separated list of number of CPUs to use for each test");$s=31;case 31:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}BC=q;r=B.Int("test.parallel",A.GOMAXPROCS(0),"maximum test parallelism");$s=32;case 32:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}BD=r;}return;}if($f===undefined){$f={$blk:$init};}$f.$s=Line truncated
|
||||||
$packages["unicode/utf16"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})();
|
$packages["unicode/utf16"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})();
|
||||||
$packages["encoding/json"]=(function(){var $pkg={},$init,B,C,D,E,F,P,Q,M,G,H,N,I,O,A,J,K,L,X,AK,AL,AM,AO,AQ,AU,BJ,BP,BR,BU,BW,BY,CA,CF,CG,CI,CJ,CY,CZ,ER,ET,EU,EV,EW,EX,EY,EZ,FA,FB,FC,FD,FG,FH,FI,FJ,FN,FS,FT,FV,FW,FX,FY,FZ,GA,GB,GC,GD,GE,AA,AD,AP,AV,AY,AZ,BK,BL,CM,a,b,Y,AH,AT,AW,AX,BA,BB,BC,BD,BE,BF,BG,BH,BI,BM,BN,BO,BQ,BS,BT,BV,BX,BZ,CB,CC,CD,CE,CH,CK,CL,CN,CO,CP,CQ,CR,CT,DA,DB,DC,DD,DE,DF,DG,DH,DI,DJ,DK,DL,DM,DN,DO,DP,DQ,DR,DS,DT,DU,DV,DW,DX,DY,DZ,EA,EB,EC,ED,EE,EF,EG,ES;B=$packages["bytes"];C=$packages["encoding"];D=$packages["encoding/base64"];E=$packages["errors"];F=$packages["fmt"];P=$packages["github.com/gopherjs/gopherjs/nosync"];Q=$packages["io"];M=$packages["math"];G=$packages["reflect"];H=$packages["runtime"];N=$packages["sort"];I=$packages["strconv"];O=$packages["strings"];A=$packages["testing"];J=$packages["unicode"];K=$packages["unicode/utf16"];L=$packages["unicode/utf8"];X=$pkg.Number=$newType(8,$kindString,"json.Number","Number","encoding/json",null);AK=$pkg.Marshaler=$newType(8,$kindInterface,"json.Marshaler","Marshaler","encoding/json",null);AL=$pkg.UnsupportedTypeError=$newType(0,$kindStruct,"json.UnsupportedTypeError","UnsupportedTypeError","encoding/json",function(Type_){this.$val=this;if(arguments.length===0){this.Type=$ifaceNil;return;}this.Type=Type_;});AM=$pkg.UnsupportedValueError=$newType(0,$kindStruct,"json.UnsupportedValueError","UnsupportedValueError","encoding/json",function(Value_,Str_){this.$val=this;if(arguments.length===0){this.Value=new G.Value.ptr(FD.nil,0,0);this.Str="";return;}this.Value=Value_;this.Str=Str_;});AO=$pkg.MarshalerError=$newType(0,$kindStruct,"json.MarshalerError","MarshalerError","encoding/json",function(Type_,Err_){this.$val=this;if(arguments.length===0){this.Type=$ifaceNil;this.Err=$ifaceNil;return;}this.Type=Type_;this.Err=Err_;});AQ=$pkg.encodeState=$newType(0,$kindStruct,"json.encodeState","encodeState","encoding/json",function(Buffer_,scratch_){this.$val=this;if(arguments.length===0){this.Buffer=new B.Buffer.ptr(EZ.nil,0,FG.zero(),FH.zero(),0);this.scratch=FH.zero();return;}this.Buffer=Buffer_;this.scratch=scratch_;});AU=$pkg.encoderFunc=$newType(4,$kindFunc,"json.encoderFunc","encoderFunc","encoding/json",null);BJ=$pkg.floatEncoder=$newType(4,$kindInt,"json.floatEncoder","floatEncoder","encoding/json",null);BP=$pkg.structEncoder=$newType(0,$kindStruct,"json.structEncoder","structEncoder","encoding/json",function(fields_,fieldEncs_){this.$val=this;if(arguments.length===0){this.fields=EW.nil;this.fieldEncs=FJ.nil;return;}this.fields=fields_;this.fieldEncs=fieldEncs_;});BR=$pkg.mapEncoder=$newType(0,$kindStruct,"json.mapEncoder","mapEncoder","encoding/json",function(elemEnc_){this.$val=this;if(arguments.length===0){this.elemEnc=$throwNilPointerError;return;}this.elemEnc=elemEnc_;});BU=$pkg.sliceEncoder=$newType(0,$kindStruct,"json.sliceEncoder","sliceEncoder","encoding/json",function(arrayEnc_){this.$val=this;if(arguments.length===0){this.arrayEnc=$throwNilPointerError;return;}this.arrayEnc=arrayEnc_;});BW=$pkg.arrayEncoder=$newType(0,$kindStruct,"json.arrayEncoder","arrayEncoder","encoding/json",function(elemEnc_){this.$val=this;if(arguments.length===0){this.elemEnc=$throwNilPointerError;return;}this.elemEnc=elemEnc_;});BY=$pkg.ptrEncoder=$newType(0,$kindStruct,"json.ptrEncoder","ptrEncoder","encoding/json",function(elemEnc_){this.$val=this;if(arguments.length===0){this.elemEnc=$throwNilPointerError;return;}this.elemEnc=elemEnc_;});CA=$pkg.condAddrEncoder=$newType(0,$kindStruct,"json.condAddrEncoder","condAddrEncoder","encoding/json",function(canAddrEnc_,elseEnc_){this.$val=this;if(arguments.length===0){this.canAddrEnc=$throwNilPointerError;this.elseEnc=$throwNilPointerError;return;}this.canAddrEnc=canAddrEnc_;this.elseEnc=elseEnc_;});CF=$pkg.stringValues=$newType(12,$kindSlice,"json.stringValues","stringValues","encoding/json",null);CG=$pkg.field=$newType(0,$kindStruct,"json.field","field","encoding/json",function(name_,nameBytes_,equalFold_,tag_,index_,typ_,omitEmpty_,quoted_){this.$val=this;if(arguments.length===0){this.name="";this.nameBytes=EZ.nil;this.equalFold=$throwNilPointerError;this.tag=false;this.index=FC.nil;this.typ=$ifaceNil;this.omitEmpty=false;this.quoted=false;return;}this.name=name_;this.nameBytes=nameBytes_;this.equalFold=equalFold_;this.tag=tag_;this.index=index_;this.typ=typ_;this.omitEmpty=omitEmpty_;this.quoted=quoted_;});CI=$pkg.byName=$newType(12,$kindSlice,"json.byName","byName","encoding/json",null);CJ=$pkg.byIndex=$newType(12,$kindSlice,"json.byIndex","byIndex","encoding/json",null);CY=$pkg.SyntaxError=$newType(0,$kindStruct,"json.SyntaxError","SyntaxError","encoding/json",function(msg_,Offset_){this.$val=this;if(arguments.length===0){this.msg="";this.Offset=new $Int64(0,0);return;}this.msg=msg_;this.Offset=Offset_;});CZ=$pkg.scanner=$newType(0,$kindStruct,"json.scanner","scanner","encoding/json",function(step_,endTop_,parseState_,err_,redo_,redoCode_,redoState_,bytes_){this.$val=this;if(arguments.length===0){this.step=$Line truncated
|
$packages["encoding/json"]=(function(){var $pkg={},$init,B,C,D,E,F,P,Q,M,G,H,N,I,O,A,J,K,L,X,AK,AL,AM,AO,AQ,AU,BJ,BP,BR,BU,BW,BY,CA,CF,CG,CI,CJ,CY,CZ,ER,ET,EU,EV,EW,EX,EY,EZ,FA,FB,FC,FD,FG,FH,FI,FJ,FN,FS,FT,FV,FW,FX,FY,FZ,GA,GB,GC,GD,GE,AA,AD,AP,AV,AY,AZ,BK,BL,CM,a,b,Y,AH,AT,AW,AX,BA,BB,BC,BD,BE,BF,BG,BH,BI,BM,BN,BO,BQ,BS,BT,BV,BX,BZ,CB,CC,CD,CE,CH,CK,CL,CN,CO,CP,CQ,CR,CT,DA,DB,DC,DD,DE,DF,DG,DH,DI,DJ,DK,DL,DM,DN,DO,DP,DQ,DR,DS,DT,DU,DV,DW,DX,DY,DZ,EA,EB,EC,ED,EE,EF,EG,ES;B=$packages["bytes"];C=$packages["encoding"];D=$packages["encoding/base64"];E=$packages["errors"];F=$packages["fmt"];P=$packages["github.com/gopherjs/gopherjs/nosync"];Q=$packages["io"];M=$packages["math"];G=$packages["reflect"];H=$packages["runtime"];N=$packages["sort"];I=$packages["strconv"];O=$packages["strings"];A=$packages["testing"];J=$packages["unicode"];K=$packages["unicode/utf16"];L=$packages["unicode/utf8"];X=$pkg.Number=$newType(8,$kindString,"json.Number","Number","encoding/json",null);AK=$pkg.Marshaler=$newType(8,$kindInterface,"json.Marshaler","Marshaler","encoding/json",null);AL=$pkg.UnsupportedTypeError=$newType(0,$kindStruct,"json.UnsupportedTypeError","UnsupportedTypeError","encoding/json",function(Type_){this.$val=this;if(arguments.length===0){this.Type=$ifaceNil;return;}this.Type=Type_;});AM=$pkg.UnsupportedValueError=$newType(0,$kindStruct,"json.UnsupportedValueError","UnsupportedValueError","encoding/json",function(Value_,Str_){this.$val=this;if(arguments.length===0){this.Value=new G.Value.ptr(FD.nil,0,0);this.Str="";return;}this.Value=Value_;this.Str=Str_;});AO=$pkg.MarshalerError=$newType(0,$kindStruct,"json.MarshalerError","MarshalerError","encoding/json",function(Type_,Err_){this.$val=this;if(arguments.length===0){this.Type=$ifaceNil;this.Err=$ifaceNil;return;}this.Type=Type_;this.Err=Err_;});AQ=$pkg.encodeState=$newType(0,$kindStruct,"json.encodeState","encodeState","encoding/json",function(Buffer_,scratch_){this.$val=this;if(arguments.length===0){this.Buffer=new B.Buffer.ptr(EZ.nil,0,FG.zero(),FH.zero(),0);this.scratch=FH.zero();return;}this.Buffer=Buffer_;this.scratch=scratch_;});AU=$pkg.encoderFunc=$newType(4,$kindFunc,"json.encoderFunc","encoderFunc","encoding/json",null);BJ=$pkg.floatEncoder=$newType(4,$kindInt,"json.floatEncoder","floatEncoder","encoding/json",null);BP=$pkg.structEncoder=$newType(0,$kindStruct,"json.structEncoder","structEncoder","encoding/json",function(fields_,fieldEncs_){this.$val=this;if(arguments.length===0){this.fields=EW.nil;this.fieldEncs=FJ.nil;return;}this.fields=fields_;this.fieldEncs=fieldEncs_;});BR=$pkg.mapEncoder=$newType(0,$kindStruct,"json.mapEncoder","mapEncoder","encoding/json",function(elemEnc_){this.$val=this;if(arguments.length===0){this.elemEnc=$throwNilPointerError;return;}this.elemEnc=elemEnc_;});BU=$pkg.sliceEncoder=$newType(0,$kindStruct,"json.sliceEncoder","sliceEncoder","encoding/json",function(arrayEnc_){this.$val=this;if(arguments.length===0){this.arrayEnc=$throwNilPointerError;return;}this.arrayEnc=arrayEnc_;});BW=$pkg.arrayEncoder=$newType(0,$kindStruct,"json.arrayEncoder","arrayEncoder","encoding/json",function(elemEnc_){this.$val=this;if(arguments.length===0){this.elemEnc=$throwNilPointerError;return;}this.elemEnc=elemEnc_;});BY=$pkg.ptrEncoder=$newType(0,$kindStruct,"json.ptrEncoder","ptrEncoder","encoding/json",function(elemEnc_){this.$val=this;if(arguments.length===0){this.elemEnc=$throwNilPointerError;return;}this.elemEnc=elemEnc_;});CA=$pkg.condAddrEncoder=$newType(0,$kindStruct,"json.condAddrEncoder","condAddrEncoder","encoding/json",function(canAddrEnc_,elseEnc_){this.$val=this;if(arguments.length===0){this.canAddrEnc=$throwNilPointerError;this.elseEnc=$throwNilPointerError;return;}this.canAddrEnc=canAddrEnc_;this.elseEnc=elseEnc_;});CF=$pkg.stringValues=$newType(12,$kindSlice,"json.stringValues","stringValues","encoding/json",null);CG=$pkg.field=$newType(0,$kindStruct,"json.field","field","encoding/json",function(name_,nameBytes_,equalFold_,tag_,index_,typ_,omitEmpty_,quoted_){this.$val=this;if(arguments.length===0){this.name="";this.nameBytes=EZ.nil;this.equalFold=$throwNilPointerError;this.tag=false;this.index=FC.nil;this.typ=$ifaceNil;this.omitEmpty=false;this.quoted=false;return;}this.name=name_;this.nameBytes=nameBytes_;this.equalFold=equalFold_;this.tag=tag_;this.index=index_;this.typ=typ_;this.omitEmpty=omitEmpty_;this.quoted=quoted_;});CI=$pkg.byName=$newType(12,$kindSlice,"json.byName","byName","encoding/json",null);CJ=$pkg.byIndex=$newType(12,$kindSlice,"json.byIndex","byIndex","encoding/json",null);CY=$pkg.SyntaxError=$newType(0,$kindStruct,"json.SyntaxError","SyntaxError","encoding/json",function(msg_,Offset_){this.$val=this;if(arguments.length===0){this.msg="";this.Offset=new $Int64(0,0);return;}this.msg=msg_;this.Offset=Offset_;});CZ=$pkg.scanner=$newType(0,$kindStruct,"json.scanner","scanner","encoding/json",function(step_,endTop_,parseState_,err_,redo_,redoCode_,redoState_,bytes_){this.$val=this;if(arguments.length===0){this.step=$Line truncated
|
||||||
$packages["github.com/ZiRo-/cuckgo/cuckoo"]=(function(){var $pkg={},$init,A,B,C,H,I,M,N,O,P,R,S,T,D,E,F,G,K;A=$packages["crypto/sha256"];B=$packages["encoding/json"];C=$pkg.Cuckoo=$newType(0,$kindStruct,"cuckoo.Cuckoo","Cuckoo","github.com/ZiRo-/cuckgo/cuckoo",function(v_){this.$val=this;if(arguments.length===0){this.v=N.zero();return;}this.v=v_;});H=$pkg.Edge=$newType(0,$kindStruct,"cuckoo.Edge","Edge","github.com/ZiRo-/cuckgo/cuckoo",function(U_,V_){this.$val=this;if(arguments.length===0){this.U=new $Uint64(0,0);this.V=new $Uint64(0,0);return;}this.U=U_;this.V=V_;});I=$pkg.CuckooJSON=$newType(0,$kindStruct,"cuckoo.CuckooJSON","CuckooJSON","github.com/ZiRo-/cuckgo/cuckoo",function(Parameter_,InputData_,Cycle_){this.$val=this;if(arguments.length===0){this.Parameter=false;this.InputData=P.nil;this.Cycle=O.nil;return;}this.Parameter=Parameter_;this.InputData=InputData_;this.Cycle=Cycle_;});M=$arrayType($Uint8,32);N=$arrayType($Uint64,4);O=$sliceType($Uint64);P=$sliceType($Uint8);R=$ptrType(H);S=$ptrType(C);T=$mapType($String,$Uint64);D=function(a){var $ptr,a,b;return(b=new $Uint64(0,a),new $Uint64(b.$high&0,(b.$low&255)>>>0));};E=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;a=$clone(a,M);return(c=(d=(e=(f=(g=(h=(i=D(((b<0||b>=a.length)?$throwRuntimeError("index out of range"):a[b])),j=$shiftLeft64(D((k=b+1>>0,((k<0||k>=a.length)?$throwRuntimeError("index out of range"):a[k]))),8),new $Uint64(i.$high|j.$high,(i.$low|j.$low)>>>0)),l=$shiftLeft64(D((m=b+2>>0,((m<0||m>=a.length)?$throwRuntimeError("index out of range"):a[m]))),16),new $Uint64(h.$high|l.$high,(h.$low|l.$low)>>>0)),n=$shiftLeft64(D((o=b+3>>0,((o<0||o>=a.length)?$throwRuntimeError("index out of range"):a[o]))),24),new $Uint64(g.$high|n.$high,(g.$low|n.$low)>>>0)),p=$shiftLeft64(D((q=b+4>>0,((q<0||q>=a.length)?$throwRuntimeError("index out of range"):a[q]))),32),new $Uint64(f.$high|p.$high,(f.$low|p.$low)>>>0)),r=$shiftLeft64(D((s=b+5>>0,((s<0||s>=a.length)?$throwRuntimeError("index out of range"):a[s]))),40),new $Uint64(e.$high|r.$high,(e.$low|r.$low)>>>0)),t=$shiftLeft64(D((u=b+6>>0,((u<0||u>=a.length)?$throwRuntimeError("index out of range"):a[u]))),48),new $Uint64(d.$high|t.$high,(d.$low|t.$low)>>>0)),v=$shiftLeft64(D((w=b+7>>0,((w<0||w>=a.length)?$throwRuntimeError("index out of range"):a[w]))),56),new $Uint64(c.$high|v.$high,(c.$low|v.$low)>>>0));};F=function(a){var $ptr,a,b;b=$clone(A.Sum256(a),M);return G(b);};$pkg.NewCuckoo=F;G=function(a){var $ptr,a,b,c,d;a=$clone(a,M);b=new C.ptr(N.zero());c=E(a,0);d=E(a,8);b.v[0]=new $Uint64(c.$high^1936682341,(c.$low^1886610805)>>>0);b.v[1]=new $Uint64(d.$high^1685025377,(d.$low^1852075885)>>>0);b.v[2]=new $Uint64(c.$high^1819895653,(c.$low^1852142177)>>>0);b.v[3]=new $Uint64(d.$high^1952801890,(d.$low^2037671283)>>>0);return b;};$pkg.NewCuckooSHA=G;H.ptr.prototype.HashCode=function(){var $ptr,a;a=this;return((a.U.$low>>0)^(a.V.$low>>0))>>0;};H.prototype.HashCode=function(){return this.$val.HashCode();};C.ptr.prototype.Sipedge=function(a){var $ptr,a,b;b=this;return new H.ptr(b.Sipnode(a,0),b.Sipnode(a,1));};C.prototype.Sipedge=function(a){return this.$val.Sipedge(a);};C.ptr.prototype.siphash24=function(a){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,di,dj,dk,dl,dm,dn,dp,dq,dr,ds,dt,du,dv,dw,dx,dy,dz,e,ea,eb,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b=this;c=b.v[0];d=b.v[1];e=b.v[2];g=(f=b.v[3],new $Uint64(f.$high^a.$high,(f.$low^a.$low)>>>0));c=(h=d,new $Uint64(c.$high+h.$high,c.$low+h.$low));e=(i=g,new $Uint64(e.$high+i.$high,e.$low+i.$low));d=(j=$shiftLeft64(d,13),k=$shiftRightUint64(d,51),new $Uint64(j.$high|k.$high,(j.$low|k.$low)>>>0));g=(l=$shiftLeft64(g,16),m=$shiftRightUint64(g,48),new $Uint64(l.$high|m.$high,(l.$low|m.$low)>>>0));d=(n=c,new $Uint64(d.$high^n.$high,(d.$low^n.$low)>>>0));g=(o=e,new $Uint64(g.$high^o.$high,(g.$low^o.$low)>>>0));c=(p=$shiftLeft64(c,32),q=$shiftRightUint64(c,32),new $Uint64(p.$high|q.$high,(p.$low|q.$low)>>>0));e=(r=d,new $Uint64(e.$high+r.$high,e.$low+r.$low));c=(s=g,new $Uint64(c.$high+s.$high,c.$low+s.$low));d=(t=$shiftLeft64(d,17),u=$shiftRightUint64(d,47),new $Uint64(t.$high|u.$high,(t.$low|u.$low)>>>0));g=(v=$shiftLeft64(g,21),w=$shiftRightUint64(g,43),new $Uint64(v.$high|w.$high,(v.$low|w.$low)>>>0));d=(x=e,new $Uint64(d.$high^x.$high,(d.$low^x.$low)>>>0));g=(y=c,new $Uint64(g.$high^y.$high,(g.$low^y.$low)>>>0));e=(z=$shiftLeft64(e,32),aa=$shiftRightUint64(e,32),new $Uint64(z.$high|aa.$high,(z.$low|aa.$low)>>>0));c=(ab=d,new $Uint64(c.$high+ab.$high,c.$low+ab.$low));e=(ac=g,new $Uint64(e.$high+ac.$high,e.$low+ac.$low));d=(ad=$shiftLeft64(d,13),ae=$shiftRightUint64(d,51),new $Uint64(ad.$high|ae.$high,(ad.$low|ae.$low)>>>0));g=(af=$shiftLeft64(g,16),ag=$shiftRightUint64(g,48),new $Uint64(af.$high|ag.$high,(af.$lLine truncated
|
$packages["github.com/ZiRo-/cuckgo/miner_js"]=(function(){var $pkg={},$init,C,A,D,E,B,F,K,N,U,Y,Z,AA,AB,AC,AD,AE,AF,AG,AH,AJ,AK,L,G,H,I,J,M,O,P,Q,R,S,T,W;C=$packages["crypto/rand"];A=$packages["crypto/sha256"];D=$packages["encoding/base64"];E=$packages["encoding/json"];B=$packages["github.com/gopherjs/gopherjs/js"];F=$pkg.Cuckoo=$newType(0,$kindStruct,"main.Cuckoo","Cuckoo","github.com/ZiRo-/cuckgo/miner_js",function(v_,key_){this.$val=this;if(arguments.length===0){this.v=Z.zero();this.key=AA.nil;return;}this.v=v_;this.key=key_;});K=$pkg.Edge=$newType(0,$kindStruct,"main.Edge","Edge","github.com/ZiRo-/cuckgo/miner_js",function(U_,V_){this.$val=this;if(arguments.length===0){this.U=new $Uint64(0,0);this.V=new $Uint64(0,0);return;}this.U=U_;this.V=V_;});N=$pkg.CuckooSolve=$newType(0,$kindStruct,"main.CuckooSolve","CuckooSolve","github.com/ZiRo-/cuckgo/miner_js",function(graph_,easiness_,cuckoo_,sols_,nsols_,nthreads_){this.$val=this;if(arguments.length===0){this.graph=AC.nil;this.easiness=0;this.cuckoo=AD.nil;this.sols=AE.nil;this.nsols=0;this.nthreads=0;return;}this.graph=graph_;this.easiness=easiness_;this.cuckoo=cuckoo_;this.sols=sols_;this.nsols=nsols_;this.nthreads=nthreads_;});U=$pkg.CuckooJSON=$newType(0,$kindStruct,"main.CuckooJSON","CuckooJSON","github.com/ZiRo-/cuckgo/miner_js",function(Parameter_,InputData_,Cycle_){this.$val=this;if(arguments.length===0){this.Parameter=false;this.InputData=AA.nil;this.Cycle=AB.nil;return;}this.Parameter=Parameter_;this.InputData=InputData_;this.Cycle=Cycle_;});Y=$arrayType($Uint8,32);Z=$arrayType($Uint64,4);AA=$sliceType($Uint8);AB=$sliceType($Uint64);AC=$ptrType(F);AD=$sliceType($Int);AE=$sliceType(AD);AF=$ptrType(K);AG=$funcType([$Float64],[$String],false);AH=$mapType($String,$emptyInterface);AJ=$ptrType(N);AK=$mapType($String,$Uint64);G=function(a){var $ptr,a,b;return(b=new $Uint64(0,a),new $Uint64(b.$high&0,(b.$low&255)>>>0));};H=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;a=$clone(a,Y);return(c=(d=(e=(f=(g=(h=(i=G(((b<0||b>=a.length)?$throwRuntimeError("index out of range"):a[b])),j=$shiftLeft64(G((k=b+1>>0,((k<0||k>=a.length)?$throwRuntimeError("index out of range"):a[k]))),8),new $Uint64(i.$high|j.$high,(i.$low|j.$low)>>>0)),l=$shiftLeft64(G((m=b+2>>0,((m<0||m>=a.length)?$throwRuntimeError("index out of range"):a[m]))),16),new $Uint64(h.$high|l.$high,(h.$low|l.$low)>>>0)),n=$shiftLeft64(G((o=b+3>>0,((o<0||o>=a.length)?$throwRuntimeError("index out of range"):a[o]))),24),new $Uint64(g.$high|n.$high,(g.$low|n.$low)>>>0)),p=$shiftLeft64(G((q=b+4>>0,((q<0||q>=a.length)?$throwRuntimeError("index out of range"):a[q]))),32),new $Uint64(f.$high|p.$high,(f.$low|p.$low)>>>0)),r=$shiftLeft64(G((s=b+5>>0,((s<0||s>=a.length)?$throwRuntimeError("index out of range"):a[s]))),40),new $Uint64(e.$high|r.$high,(e.$low|r.$low)>>>0)),t=$shiftLeft64(G((u=b+6>>0,((u<0||u>=a.length)?$throwRuntimeError("index out of range"):a[u]))),48),new $Uint64(d.$high|t.$high,(d.$low|t.$low)>>>0)),v=$shiftLeft64(G((w=b+7>>0,((w<0||w>=a.length)?$throwRuntimeError("index out of range"):a[w]))),56),new $Uint64(c.$high|v.$high,(c.$low|v.$low)>>>0));};I=function(a){var $ptr,a,b;b=$clone(A.Sum256(a),Y);return J(b);};$pkg.NewCuckoo=I;J=function(a){var $ptr,a,b,c,d;a=$clone(a,Y);b=new F.ptr(Z.zero(),AA.nil);c=H(a,0);d=H(a,8);b.v[0]=new $Uint64(c.$high^1936682341,(c.$low^1886610805)>>>0);b.v[1]=new $Uint64(d.$high^1685025377,(d.$low^1852075885)>>>0);b.v[2]=new $Uint64(c.$high^1819895653,(c.$low^1852142177)>>>0);b.v[3]=new $Uint64(d.$high^1952801890,(d.$low^2037671283)>>>0);b.key=new AA(a);return b;};$pkg.NewCuckooSHA=J;K.ptr.prototype.HashCode=function(){var $ptr,a;a=this;return((a.U.$low>>0)^(a.V.$low>>0))>>0;};K.prototype.HashCode=function(){return this.$val.HashCode();};F.ptr.prototype.Sipedge=function(a){var $ptr,a,b;b=this;return new K.ptr(b.Sipnode(a,0),b.Sipnode(a,1));};F.prototype.Sipedge=function(a){return this.$val.Sipedge(a);};F.ptr.prototype.siphash24=function(a){var $ptr,a,b;b=this;return M(b.key,a);};F.prototype.siphash24=function(a){return this.$val.siphash24(a);};M=function(a,b){var $ptr,a,b,c,d,e,f;c=L.hash($externalize(a,AA),0,$externalize(b,$Uint64));d=$internalize(c[0],$Uint64);e=$internalize(c[1],$Uint64);return(f=$shiftLeft64(d,32),new $Uint64(f.$high|e.$high,(f.$low|e.$low)>>>0));};F.ptr.prototype.Sipnode=function(a,b){var $ptr,a,b,c,d,e,f;c=this;return(d=c.siphash24((e=$mul64(new $Uint64(0,2),a),f=new $Uint64(0,b),new $Uint64(e.$high+f.$high,e.$low+f.$low))),new $Uint64(d.$high&0,(d.$low&524287)>>>0));};F.prototype.Sipnode=function(a,b){return this.$val.Sipnode(a,b);};F.ptr.prototype.Verify=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;c=this;d=$makeSlice(AB,42);e=$makeSlice(AB,42);f=0;g=new $Uint64(0,0);g=new $Uint64(0,0);while(true){if(!((g.$high<0||(g.$high===0&&g.$low<42)))){break;}if((h=(($flatten64(g)<0||$flatten64(g)>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+$flatten64(g)]),(h.$high>b.$high||(h.$hLine truncated
|
||||||
$packages["github.com/ZiRo-/cuckgo/miner_js"]=(function(){var $pkg={},$init,A,B,C,D,E,F,M,N,O,P,Q,R,S,T,U,V,G,H,I,J,K,L;A=$packages["crypto/rand"];B=$packages["crypto/sha256"];C=$packages["encoding/base64"];D=$packages["github.com/ZiRo-/cuckgo/cuckoo"];E=$packages["github.com/gopherjs/gopherjs/js"];F=$pkg.CuckooSolve=$newType(0,$kindStruct,"main.CuckooSolve","CuckooSolve","github.com/ZiRo-/cuckgo/miner_js",function(graph_,easiness_,cuckoo_,sols_,nsols_,nthreads_){this.$val=this;if(arguments.length===0){this.graph=M.nil;this.easiness=0;this.cuckoo=N.nil;this.sols=O.nil;this.nsols=0;this.nthreads=0;return;}this.graph=graph_;this.easiness=easiness_;this.cuckoo=cuckoo_;this.sols=sols_;this.nsols=nsols_;this.nthreads=nthreads_;});M=$ptrType(D.Cuckoo);N=$sliceType($Int);O=$sliceType(N);P=$ptrType(D.Edge);Q=$sliceType($Uint8);R=$arrayType($Uint8,32);S=$sliceType($Uint64);T=$funcType([$Float64],[$String],false);U=$mapType($String,$emptyInterface);V=$ptrType(F);G=function(a,b,c,d){var $ptr,a,b,c,d,e,f,g,h,i;e=new F.ptr(D.NewCuckoo(a),b,$makeSlice(N,1048577),$makeSlice(O,($imul(2,c))),0,1);f=e.sols;g=0;while(true){if(!(g<f.$length)){break;}h=g;(i=e.sols,((h<0||h>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+h]=$makeSlice(N,42)));g++;}return e;};$pkg.NewCuckooSolve=G;F.ptr.prototype.path=function(a,b){var $ptr,a,b,c,d,e,f;c=this;d=0;d=0;while(true){if(!(!((a===0)))){break;}d=d+(1)>>0;if(d>=4096){while(true){if(!(!((d===0))&&!(((e=d-1>>0,((e<0||e>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+e]))===a)))){break;}d=d-(1)>>0;}if(d<0){}else{}return-1;}((d<0||d>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+d]=a);a=(f=c.cuckoo,((a<0||a>=f.$length)?$throwRuntimeError("index out of range"):f.$array[f.$offset+a]));}return d;};F.prototype.path=function(a,b){return this.$val.path(a,b);};F.ptr.prototype.solution=function(a,b,c,d){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,ai,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=this;f={};g=0;i=new D.Edge.ptr(new $Uint64(0,(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0])),(h=new $Uint64(0,(0>=c.$length?$throwRuntimeError("index out of range"):c.$array[c.$offset+0])),new $Uint64(h.$high-0,h.$low-524288)));j=i.HashCode();(f||$throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(j)]={k:j,v:i};while(true){if(!(!((b===0)))){break;}b=b-(1)>>0;n=new D.Edge.ptr(new $Uint64(0,(k=(((b+1>>0))&~1)>>0,((k<0||k>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+k]))),(l=new $Uint64(0,(m=b|1,((m<0||m>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+m]))),new $Uint64(l.$high-0,l.$low-524288)));o=(p=f[$Int.keyFor(n.HashCode())],p!==undefined?[p.v,true]:[P.nil,false]);q=o[1];if(!q){r=n.HashCode();(f||$throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(r)]={k:r,v:n};}}while(true){if(!(!((d===0)))){break;}d=d-(1)>>0;v=new D.Edge.ptr(new $Uint64(0,(s=d|1,((s<0||s>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+s]))),(t=new $Uint64(0,(u=(((d+1>>0))&~1)>>0,((u<0||u>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+u]))),new $Uint64(t.$high-0,t.$low-524288)));w=(x=f[$Int.keyFor(v.HashCode())],x!==undefined?[x.v,true]:[P.nil,false]);y=w[1];if(!y){z=v.HashCode();(f||$throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(z)]={k:z,v:v};}}g=0;aa=0;while(true){if(!(aa<e.easiness)){break;}ab=e.graph.Sipedge(new $Uint64(0,aa));ac=H(f,ab);ad=ac[0];ae=ac[1];if(ad){(af=(ag=e.sols,ah=e.nsols,((ah<0||ah>=ag.$length)?$throwRuntimeError("index out of range"):ag.$array[ag.$offset+ah])),((g<0||g>=af.$length)?$throwRuntimeError("index out of range"):af.$array[af.$offset+g]=aa));g=g+(1)>>0;delete f[$Int.keyFor(ae)];}aa=aa+(1)>>0;}if((ai=new $Uint64(0,g),(ai.$high===0&&ai.$low===42))){e.nsols=e.nsols+(1)>>0;}else{}};F.prototype.solution=function(a,b,c,d){return this.$val.solution(a,b,c,d);};H=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m;c=b.HashCode();d=a;e=0;f=$keys(d);while(true){if(!(e<f.length)){break;}g=d[f[e]];if(g===undefined){e++;continue;}h=g.k;i=g.v;if((h===c)&&(j=i.U,k=b.U,(j.$high===k.$high&&j.$low===k.$low))&&(l=i.V,m=b.V,(l.$high===m.$high&&l.$low===m.$low))){return[true,h];}e++;}return[false,0];};I=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;c=b.cuckoo;d=$makeSlice(N,4096);e=$makeSlice(N,4096);f=a;while(true){if(!(f<b.easiness)){break;}(0>=d.$length?$throwRuntimeError("index out of range"):d.$array[d.$offset+0]=(b.graph.Sipnode(new $Uint64(0,f),0).$low>>0));h=(g=(0>=d.$length?$throwRuntimeError("index out of range"):d.$array[d.$offset+0]),((g<0||g>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+g]));(0>=e.$length?$throwRuntimeError("index out of range"):e.$array[e.$offset+0]=((i=b.graph.Sipnode(new $Uint64(0,f),1),new $Uint64(0+i.$high,524288+i.$low)).$low>>0));k=(j=(0>=e.$length?$throwRuntimeError("index out of range"):e.$array[e.$offset+Line truncated
|
|
||||||
$synthesizeMethods();
|
$synthesizeMethods();
|
||||||
var $mainPkg = $packages["github.com/ZiRo-/cuckgo/miner_js"];
|
var $mainPkg = $packages["github.com/ZiRo-/cuckgo/miner_js"];
|
||||||
$packages["runtime"].$init();
|
$packages["runtime"].$init();
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
importScripts('./siphash-lib.js');
|
||||||
importScripts('./miner-js.js');
|
importScripts('./miner-js.js');
|
||||||
|
|
||||||
onmessage = function(e) {
|
onmessage = function(e) {
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
var SipHash = (function() {
|
||||||
|
function u8to64(p , i) {
|
||||||
|
return { l: (p[i] | p[i+1]<<8 | p[i+2]<<16 | p[i+3]<<24) , h: (p[i+4] | p[i+5]<<8 | p[i+6]<<16 | p[i+7]<<24) };
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _add(a, b) {
|
||||||
|
var rl = a.l + b.l,
|
||||||
|
a2 = { h: a.h + b.h + (rl / 2 >>> 31) >>> 0,
|
||||||
|
l: rl >>> 0 };
|
||||||
|
a.h = a2.h; a.l = a2.l;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _xor(a, b) {
|
||||||
|
a.h ^= b.h; a.h >>>= 0;
|
||||||
|
a.l ^= b.l; a.l >>>= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _rotl(a, n) {
|
||||||
|
var a2 = {
|
||||||
|
h: a.h << n | a.l >>> (32 - n),
|
||||||
|
l: a.l << n | a.h >>> (32 - n)
|
||||||
|
};
|
||||||
|
a.h = a2.h; a.l = a2.l;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _rotl32(a) {
|
||||||
|
var al = a.l;
|
||||||
|
a.l = a.h; a.h = al;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _compress(v0, v1, v2, v3) {
|
||||||
|
_add(v0, v1);
|
||||||
|
_add(v2, v3);
|
||||||
|
_rotl(v1, 13);
|
||||||
|
_rotl(v3, 16);
|
||||||
|
_xor(v1, v0);
|
||||||
|
_xor(v3, v2);
|
||||||
|
_rotl32(v0);
|
||||||
|
_add(v2, v1);
|
||||||
|
_add(v0, v3);
|
||||||
|
_rotl(v1, 17);
|
||||||
|
_rotl(v3, 21);
|
||||||
|
_xor(v1, v2);
|
||||||
|
_xor(v3, v0);
|
||||||
|
_rotl32(v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function hash(key, mh, ml) {
|
||||||
|
var mi = { h: mh, l: ml }
|
||||||
|
var k0 = u8to64(key, 0);
|
||||||
|
var k1 = u8to64(key, 8);
|
||||||
|
|
||||||
|
var v0 = { h: k0.h, l: k0.l }, v2 = k0;
|
||||||
|
var v1 = { h: k1.h, l: k1.l }, v3 = k1;
|
||||||
|
|
||||||
|
_xor(v0, { h: 0x736f6d65, l: 0x70736575 });
|
||||||
|
_xor(v1, { h: 0x646f7261, l: 0x6e646f6d });
|
||||||
|
_xor(v2, { h: 0x6c796765, l: 0x6e657261 });
|
||||||
|
_xor(v3, { h: 0x74656462, l: 0x79746573 });
|
||||||
|
|
||||||
|
_xor(v3, mi);
|
||||||
|
_compress(v0, v1, v2, v3);
|
||||||
|
_compress(v0, v1, v2, v3);
|
||||||
|
_xor(v0, mi);
|
||||||
|
_xor(v2, { h: 0, l: 0xff });
|
||||||
|
_compress(v0, v1, v2, v3);
|
||||||
|
_compress(v0, v1, v2, v3);
|
||||||
|
_compress(v0, v1, v2, v3);
|
||||||
|
_compress(v0, v1, v2, v3);
|
||||||
|
|
||||||
|
var h = v0;
|
||||||
|
_xor(h, v1);
|
||||||
|
_xor(h, v2);
|
||||||
|
_xor(h, v3);
|
||||||
|
|
||||||
|
var res = new Uint32Array(2);
|
||||||
|
res[0]=h.h; res[1]=h.l;
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
hash: hash,
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
|
var module = module || { }, exports = module.exports = SipHash;
|
||||||
Reference in new issue
Block a user