1-
21< script type ="text/javascript ">
3- lime . embed ( "InfiniteEngine" , "engine-content" , 548 , 448 , { parameters : { } } ) ;
2+ lime . embed ( "InfiniteEngine" , "engine-content" , 548 , 448 , { parameters : { } } ) ;
43</ script >
54
65
76< script type ="text/javascript ">
8-
7+
8+ function lzw64_encode ( s ) {
9+ if ( ! s ) return s ;
10+ var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" ;
11+ var d = new Map ( ) ;
12+ var s = unescape ( encodeURIComponent ( s ) ) . split ( "" ) ;
13+ var word = s [ 0 ] ;
14+ var num = 256 ;
15+ var key ;
16+ var o = [ ] ;
17+ function out ( word , num ) {
18+ key = word . length > 1 ? d . get ( word ) : word . charCodeAt ( 0 ) ;
19+ o . push ( b64 [ key & 0x3f ] ) ;
20+ o . push ( b64 [ ( key >> 6 ) & 0x3f ] ) ;
21+ o . push ( b64 [ ( key >> 12 ) & 0x3f ] ) ;
22+ }
23+ for ( var i = 1 ; i < s . length ; i ++ ) {
24+ var c = s [ i ] ;
25+ if ( d . has ( word + c ) ) {
26+ word += c ;
27+ } else {
28+ d . set ( word + c , num ++ ) ;
29+ out ( word , num ) ;
30+ word = c ;
31+ if ( num == ( 1 << 18 ) - 1 ) {
32+ d . clear ( ) ;
33+ num = 256 ;
34+ }
35+ }
36+ }
37+ out ( word ) ;
38+ return o . join ( "" ) ;
39+ }
40+
41+ function lzw64_decode ( s ) {
42+ var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" ;
43+ var b64d = { } ;
44+ for ( var i = 0 ; i < 64 ; i ++ ) {
45+ b64d [ b64 . charAt ( i ) ] = i ;
46+ }
47+ var d = new Map ( ) ;
48+ var num = 256 ;
49+ var word = String . fromCharCode ( b64d [ s [ 0 ] ] + ( b64d [ s [ 1 ] ] << 6 ) + ( b64d [ s [ 2 ] ] << 12 ) ) ;
50+ var prev = word ;
51+ var o = [ word ] ;
52+ for ( var i = 3 ; i < s . length ; i += 3 ) {
53+ var key = b64d [ s [ i ] ] + ( b64d [ s [ i + 1 ] ] << 6 ) + ( b64d [ s [ i + 2 ] ] << 12 ) ;
54+ word = key < 256 ? String . fromCharCode ( key ) : d . has ( key ) ? d . get ( key ) : word + word . charAt ( 0 ) ;
55+ o . push ( word ) ;
56+ d . set ( num ++ , prev + word . charAt ( 0 ) ) ;
57+ prev = word ;
58+ if ( num == ( 1 << 18 ) - 1 ) {
59+ d . clear ( ) ;
60+ num = 256 ;
61+ }
62+ }
63+ return decodeURIComponent ( escape ( o . join ( "" ) ) ) ;
64+ }
65+
66+
967 // get key from search params
1068 var urlParams = new URLSearchParams ( window . location . search ) ;
1169 var key = urlParams . get ( 'key' ) ;
12- if ( key == null )
13- {
14- key = "0" ;
70+ var minKey = '' ;
71+ var maxKey = '' ;
72+ for ( var i = 0 ; i < 128 ; i ++ ) {
73+ minKey += "0" ;
74+ maxKey += "f" ;
1575 }
16- else
17- {
76+ if ( key == null ) {
77+ key = minKey ;
78+ }
79+ else {
1880 key = key . replace ( / [ ^ a - f 0 - 9 ] / gi, '' ) ;
81+
82+ key = key . padStart ( 128 , '0' ) ;
1983 }
2084
21-
22- function getRandom ( )
23- {
24- // make a random 128-digit hex number
85+
86+ function getRandom ( ) {
87+ // make a random 128-digit hex number
2588 var r = "" ;
26- for ( var i = 0 ; i < 128 ; i ++ )
27- {
89+ for ( var i = 0 ; i < 128 ; i ++ ) {
2890 r += Math . floor ( Math . random ( ) * 16 ) . toString ( 16 ) ;
2991 }
30- return r ;
92+ return r ;
3193 }
3294
95+ console . log ( key ) ;
96+ console . log ( BigInt ( '0x' + key ) . toString ( 16 ) ) ;
97+ console . log ( BigInt ( '0x' + key ) . toString ( 36 ) ) ;
98+
99+ console . log ( lzw64_encode ( BigInt ( '0x' + key ) . toString ( 36 ) ) ) ;
100+
101+ function setValue ( Value ) {
102+ document . getElementById ( "numAdjust" ) . value = Value ;
103+ }
104+
105+
106+
107+
108+ document . getElementById ( "btnRand" ) . setAttribute ( "href" , "?key=" + getRandom ( ) ) ;
109+ document . getElementById ( "btnMinus" ) . onclick = function ( ) {
110+
111+ var numAdjust = parseInt ( document . getElementById ( "numAdjust" ) . value ) ;
112+ var numKey = BigInt ( "0x" + key ) ;
113+ numKey -= BigInt ( numAdjust ) ;
114+ if ( numKey < BigInt ( "0x" + minKey ) ) {
115+ numKey += maxKey ;
116+ }
117+ key = numKey . toString ( 16 ) ;
118+ console . log ( key ) ;
119+ window . location . href = "?key=" + key . padStart ( 128 , '0' ) ;
120+ }
121+ document . getElementById ( "btnPlus" ) . onclick = function ( ) {
122+
123+ var numAdjust = parseInt ( document . getElementById ( "numAdjust" ) . value ) ;
124+ var numKey = BigInt ( "0x" + key ) ;
125+ numKey += BigInt ( numAdjust ) ;
126+ if ( numKey > BigInt ( "0x" + maxKey ) ) {
127+ numKey -= maxKey ;
128+ }
129+ key = numKey . toString ( 16 ) ;
130+ console . log ( key ) ;
131+ window . location . href = "?key=" + key . padStart ( 128 , '0' ) ;
132+ }
133+
134+
135+
33136
34- var keys = [ ] ;
35- keys . push ( ( BigInt ( '0x' + key ) - 1000000n ) . toString ( 16 ) ) ;
36- keys . push ( ( BigInt ( '0x' + key ) - 100000n ) . toString ( 16 ) ) ;
37- keys . push ( ( BigInt ( '0x' + key ) - 10000n ) . toString ( 16 ) ) ;
38- keys . push ( ( BigInt ( '0x' + key ) - 1000n ) . toString ( 16 ) ) ;
39- keys . push ( ( BigInt ( '0x' + key ) - 100n ) . toString ( 16 ) ) ;
40- keys . push ( ( BigInt ( '0x' + key ) - 10n ) . toString ( 16 ) ) ;
41- keys . push ( ( BigInt ( '0x' + key ) - 1n ) . toString ( 16 ) ) ;
42- keys . push ( getRandom ( ) ) ;
43- keys . push ( ( BigInt ( '0x' + key ) + 1n ) . toString ( 16 ) ) ;
44- keys . push ( ( BigInt ( '0x' + key ) + 10n ) . toString ( 16 ) ) ;
45- keys . push ( ( BigInt ( '0x' + key ) + 100n ) . toString ( 16 ) ) ;
46- keys . push ( ( BigInt ( '0x' + key ) + 1000n ) . toString ( 16 ) ) ;
47- keys . push ( ( BigInt ( '0x' + key ) + 10000n ) . toString ( 16 ) ) ;
48- keys . push ( ( BigInt ( '0x' + key ) + 100000n ) . toString ( 16 ) ) ;
49- keys . push ( ( BigInt ( '0x' + key ) + 1000000n ) . toString ( 16 ) ) ;
50-
51-
52- console . log ( keys ) ;
53-
54- document . getElementById ( "min1mil" ) . setAttribute ( "href" , "?key=" + keys [ 0 ] ) ;
55- document . getElementById ( "min100k" ) . setAttribute ( "href" , "?key=" + keys [ 1 ] ) ;
56- document . getElementById ( "min10k" ) . setAttribute ( "href" , "?key=" + keys [ 2 ] ) ;
57- document . getElementById ( "min1k" ) . setAttribute ( "href" , "?key=" + keys [ 3 ] ) ;
58- document . getElementById ( "min100" ) . setAttribute ( "href" , "?key=" + keys [ 4 ] ) ;
59- document . getElementById ( "min10" ) . setAttribute ( "href" , "?key=" + keys [ 5 ] ) ;
60- document . getElementById ( "min1" ) . setAttribute ( "href" , "?key=" + keys [ 6 ] ) ;
61- document . getElementById ( "minRand" ) . setAttribute ( "href" , "?key=" + keys [ 7 ] ) ;
62- document . getElementById ( "add1" ) . setAttribute ( "href" , "?key=" + keys [ 8 ] ) ;
63- document . getElementById ( "add10" ) . setAttribute ( "href" , "?key=" + keys [ 9 ] ) ;
64- document . getElementById ( "add100" ) . setAttribute ( "href" , "?key=" + keys [ 10 ] ) ;
65- document . getElementById ( "add1k" ) . setAttribute ( "href" , "?key=" + keys [ 11 ] ) ;
66- document . getElementById ( "add10k" ) . setAttribute ( "href" , "?key=" + keys [ 12 ] ) ;
67- document . getElementById ( "add100k" ) . setAttribute ( "href" , "?key=" + keys [ 13 ] ) ;
68- document . getElementById ( "add1mil" ) . setAttribute ( "href" , "?key=" + keys [ 14 ] ) ;
69-
70-
71-
72137
73138
74139</ script >
0 commit comments