diff --git a/build/standalone/static/lib/rusha/coverage/Firefox 57.0.0 (Mac OS X 10.11.0)/base.css b/build/standalone/static/lib/rusha/coverage/Firefox 57.0.0 (Mac OS X 10.11.0)/base.css deleted file mode 100644 index 29737bcb..00000000 --- a/build/standalone/static/lib/rusha/coverage/Firefox 57.0.0 (Mac OS X 10.11.0)/base.css +++ /dev/null @@ -1,213 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } -/* dark yellow (gold) */ -.medium .chart { border:1px solid #f9cd0b; } -.status-line.medium, .medium .cover-fill { background: #f9cd0b; } -/* light yellow */ -.medium { background: #fff4c2; } -/* light gray */ -span.cline-neutral { background: #eaeaea; } - -.cbranch-no { background: yellow !important; color: #111; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/build/standalone/static/lib/rusha/coverage/Firefox 57.0.0 (Mac OS X 10.11.0)/dist/index.html b/build/standalone/static/lib/rusha/coverage/Firefox 57.0.0 (Mac OS X 10.11.0)/dist/index.html deleted file mode 100644 index 6a50c337..00000000 --- a/build/standalone/static/lib/rusha/coverage/Firefox 57.0.0 (Mac OS X 10.11.0)/dist/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - -
-| File | -- | Statements | -- | Branches | -- | Functions | -- | Lines | -- |
|---|---|---|---|---|---|---|---|---|---|
| rusha.js | -12.47% | -54/433 | -11.11% | -18/162 | -21.05% | -12/57 | -8.67% | -34/392 | -|
| rusha.min.js | -12.47% | -54/433 | -11.11% | -18/162 | -21.05% | -12/57 | -100% | -1/1 | -
| 1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 | 9× -1× -1× -1× - -1× - -1× - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1× - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1× - - -1× - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1× -1× - -1× - - - - -1× - - - - -1× - - - - - - - - - - -1× - - - - - - - - -1× - -1× -1× - - - - -1× - - -1× - - -1× - - - - - - - - - -1× - -1× - - -1× - - - - -1× -1× - - - - -1× - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1× - - - - -1× - - - - - - - - - - - - - -1× -1× -256× - - -1× - - - - - - - - - - - - -1× - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | (function(f){Iif(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else Iif(typeof define==="function"&&define.amd){define([],f)}else{var g;Eif(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Rusha = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){Iif(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-var bundleFn = arguments[3];
-var sources = arguments[4];
-var cache = arguments[5];
-
-var stringify = JSON.stringify;
-
-module.exports = function (fn, options) {
- var wkey;
- var cacheKeys = Object.keys(cache);
-
- for (var i = 0, l = cacheKeys.length; i < l; i++) {
- var key = cacheKeys[i];
- var exp = cache[key].exports;
- // Using babel as a transpiler to use esmodule, the export will always
- // be an object with the default export as a property of it. To ensure
- // the existing api and babel esmodule exports are both supported we
- // check for both
- if (exp === fn || exp && exp.default === fn) {
- wkey = key;
- break;
- }
- }
-
- if (!wkey) {
- wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);
- var wcache = {};
- for (var i = 0, l = cacheKeys.length; i < l; i++) {
- var key = cacheKeys[i];
- wcache[key] = key;
- }
- sources[wkey] = [
- 'function(require,module,exports){' + fn + '(self); }',
- wcache
- ];
- }
- var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);
-
- var scache = {}; scache[wkey] = wkey;
- sources[skey] = [
- 'function(require,module,exports){' +
- // try to call default if defined to also support babel esmodule exports
- 'var f = require(' + stringify(wkey) + ');' +
- '(f.default ? f.default : f)(self);' +
- '}',
- scache
- ];
-
- var workerSources = {};
- resolveSources(skey);
-
- function resolveSources(key) {
- workerSources[key] = true;
-
- for (var depPath in sources[key][1]) {
- var depKey = sources[key][1][depPath];
- if (!workerSources[depKey]) {
- resolveSources(depKey);
- }
- }
- }
-
- var src = '(' + bundleFn + ')({'
- + Object.keys(workerSources).map(function (key) {
- return stringify(key) + ':['
- + sources[key][0]
- + ',' + stringify(sources[key][1]) + ']'
- ;
- }).join(',')
- + '},{},[' + stringify(skey) + '])'
- ;
-
- var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
-
- var blob = new Blob([src], { type: 'text/javascript' });
- if (options && options.bare) { return blob; }
- var workerUrl = URL.createObjectURL(blob);
- var worker = new Worker(workerUrl);
- worker.objectURL = workerUrl;
- return worker;
-};
-
-},{}],2:[function(require,module,exports){
-// The low-level RushCore module provides the heart of Rusha,
-// a high-speed sha1 implementation working on an Int32Array heap.
-// At first glance, the implementation seems complicated, however
-// with the SHA1 spec at hand, it is obvious this almost a textbook
-// implementation that has a few functions hand-inlined and a few loops
-// hand-unrolled.
-module.exports = function RushaCore(stdlib$1186, foreign$1187, heap$1188) {
- 'use asm';
- var H$1189 = new stdlib$1186.Int32Array(heap$1188);
- function hash$1190(k$1191, x$1192) {
- // k in bytes
- k$1191 = k$1191 | 0;
- x$1192 = x$1192 | 0;
- var i$1193 = 0, j$1194 = 0, y0$1195 = 0, z0$1196 = 0, y1$1197 = 0, z1$1198 = 0, y2$1199 = 0, z2$1200 = 0, y3$1201 = 0, z3$1202 = 0, y4$1203 = 0, z4$1204 = 0, t0$1205 = 0, t1$1206 = 0;
- y0$1195 = H$1189[x$1192 + 320 >> 2] | 0;
- y1$1197 = H$1189[x$1192 + 324 >> 2] | 0;
- y2$1199 = H$1189[x$1192 + 328 >> 2] | 0;
- y3$1201 = H$1189[x$1192 + 332 >> 2] | 0;
- y4$1203 = H$1189[x$1192 + 336 >> 2] | 0;
- for (i$1193 = 0; (i$1193 | 0) < (k$1191 | 0); i$1193 = i$1193 + 64 | 0) {
- z0$1196 = y0$1195;
- z1$1198 = y1$1197;
- z2$1200 = y2$1199;
- z3$1202 = y3$1201;
- z4$1204 = y4$1203;
- for (j$1194 = 0; (j$1194 | 0) < 64; j$1194 = j$1194 + 4 | 0) {
- t1$1206 = H$1189[i$1193 + j$1194 >> 2] | 0;
- t0$1205 = ((y0$1195 << 5 | y0$1195 >>> 27) + (y1$1197 & y2$1199 | ~y1$1197 & y3$1201) | 0) + ((t1$1206 + y4$1203 | 0) + 1518500249 | 0) | 0;
- y4$1203 = y3$1201;
- y3$1201 = y2$1199;
- y2$1199 = y1$1197 << 30 | y1$1197 >>> 2;
- y1$1197 = y0$1195;
- y0$1195 = t0$1205;
- H$1189[k$1191 + j$1194 >> 2] = t1$1206;
- }
- for (j$1194 = k$1191 + 64 | 0; (j$1194 | 0) < (k$1191 + 80 | 0); j$1194 = j$1194 + 4 | 0) {
- t1$1206 = (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) << 1 | (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) >>> 31;
- t0$1205 = ((y0$1195 << 5 | y0$1195 >>> 27) + (y1$1197 & y2$1199 | ~y1$1197 & y3$1201) | 0) + ((t1$1206 + y4$1203 | 0) + 1518500249 | 0) | 0;
- y4$1203 = y3$1201;
- y3$1201 = y2$1199;
- y2$1199 = y1$1197 << 30 | y1$1197 >>> 2;
- y1$1197 = y0$1195;
- y0$1195 = t0$1205;
- H$1189[j$1194 >> 2] = t1$1206;
- }
- for (j$1194 = k$1191 + 80 | 0; (j$1194 | 0) < (k$1191 + 160 | 0); j$1194 = j$1194 + 4 | 0) {
- t1$1206 = (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) << 1 | (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) >>> 31;
- t0$1205 = ((y0$1195 << 5 | y0$1195 >>> 27) + (y1$1197 ^ y2$1199 ^ y3$1201) | 0) + ((t1$1206 + y4$1203 | 0) + 1859775393 | 0) | 0;
- y4$1203 = y3$1201;
- y3$1201 = y2$1199;
- y2$1199 = y1$1197 << 30 | y1$1197 >>> 2;
- y1$1197 = y0$1195;
- y0$1195 = t0$1205;
- H$1189[j$1194 >> 2] = t1$1206;
- }
- for (j$1194 = k$1191 + 160 | 0; (j$1194 | 0) < (k$1191 + 240 | 0); j$1194 = j$1194 + 4 | 0) {
- t1$1206 = (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) << 1 | (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) >>> 31;
- t0$1205 = ((y0$1195 << 5 | y0$1195 >>> 27) + (y1$1197 & y2$1199 | y1$1197 & y3$1201 | y2$1199 & y3$1201) | 0) + ((t1$1206 + y4$1203 | 0) - 1894007588 | 0) | 0;
- y4$1203 = y3$1201;
- y3$1201 = y2$1199;
- y2$1199 = y1$1197 << 30 | y1$1197 >>> 2;
- y1$1197 = y0$1195;
- y0$1195 = t0$1205;
- H$1189[j$1194 >> 2] = t1$1206;
- }
- for (j$1194 = k$1191 + 240 | 0; (j$1194 | 0) < (k$1191 + 320 | 0); j$1194 = j$1194 + 4 | 0) {
- t1$1206 = (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) << 1 | (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) >>> 31;
- t0$1205 = ((y0$1195 << 5 | y0$1195 >>> 27) + (y1$1197 ^ y2$1199 ^ y3$1201) | 0) + ((t1$1206 + y4$1203 | 0) - 899497514 | 0) | 0;
- y4$1203 = y3$1201;
- y3$1201 = y2$1199;
- y2$1199 = y1$1197 << 30 | y1$1197 >>> 2;
- y1$1197 = y0$1195;
- y0$1195 = t0$1205;
- H$1189[j$1194 >> 2] = t1$1206;
- }
- y0$1195 = y0$1195 + z0$1196 | 0;
- y1$1197 = y1$1197 + z1$1198 | 0;
- y2$1199 = y2$1199 + z2$1200 | 0;
- y3$1201 = y3$1201 + z3$1202 | 0;
- y4$1203 = y4$1203 + z4$1204 | 0;
- }
- H$1189[x$1192 + 320 >> 2] = y0$1195;
- H$1189[x$1192 + 324 >> 2] = y1$1197;
- H$1189[x$1192 + 328 >> 2] = y2$1199;
- H$1189[x$1192 + 332 >> 2] = y3$1201;
- H$1189[x$1192 + 336 >> 2] = y4$1203;
- }
- return { hash: hash$1190 };
-};
-
-},{}],3:[function(require,module,exports){
-'use strict';
-
-/* eslint-env commonjs, browser */
-
-var Rusha = require('./rusha.js');
-var utils = require('./utils.js');
-
-function Hash() {
- this._rusha = new Rusha();
- this._rusha.resetState();
-}
-
-Hash.prototype.update = function update(data) {
- this._rusha.append(data);
- return this;
-};
-
-Hash.prototype.digest = function digest(encoding) {
- var digest = this._rusha.rawEnd().buffer;
- if (!encoding) {
- return digest;
- }
- if (encoding === 'hex') {
- return utils.toHex(digest);
- }
- throw new Error('unsupported digest encoding');
-};
-
-module.exports = function createHash() {
- return new Hash();
-};
-
-},{"./rusha.js":5,"./utils.js":6}],4:[function(require,module,exports){
-'use strict';
-
-/* eslint-env commonjs, browser */
-
-var webworkify = require('webworkify');
-
-var Rusha = require('./rusha.js');
-var createHash = require('./hash.js');
-
-// If we're running in a webworker, accept
-// messages containing a jobid and a buffer
-// or blob object, and return the hash result.
-Iif (typeof FileReaderSync !== 'undefined' && typeof DedicatedWorkerGlobalScope !== 'undefined') {
- Rusha.disableWorkerBehaviour = require('./worker')();
-} else {
- Rusha.disableWorkerBehaviour = function () {};
-}
-
-Rusha.createWorker = function createWorker() {
- var worker = webworkify(require('./worker'));
- var terminate = worker.terminate;
- worker.terminate = function () {
- URL.revokeObjectURL(worker.objectURL);
- terminate.call(worker);
- };
- return worker;
-};
-
-Rusha.createHash = createHash;
-
-module.exports = Rusha;
-
-},{"./hash.js":3,"./rusha.js":5,"./worker":7,"webworkify":1}],5:[function(require,module,exports){
-(function (global){
-'use strict';
-
-/* eslint-env commonjs, browser */
-
-var RushaCore = require('./core.sjs');
-var utils = require('./utils');
-
-// The Rusha object is a wrapper around the low-level RushaCore.
-// It provides means of converting different inputs to the
-// format accepted by RushaCore as well as other utility methods.
-module.exports = function Rusha (chunkSize) {
- var getDataType = function (data) {
- if (typeof data === 'string') {
- return 'string';
- }
- if (data instanceof Array) {
- return 'array';
- }
- if (global.Buffer && global.Buffer.isBuffer(data)) {
- return 'buffer';
- }
- if (data instanceof ArrayBuffer) {
- return 'arraybuffer';
- }
- if (data.buffer instanceof ArrayBuffer) {
- return 'view';
- }
- if (data instanceof Blob) {
- return 'blob';
- }
- throw new Error('Unsupported data type.');
- };
-
- // Private object structure.
- var self = {};
-
- // Calculate the length of buffer that the sha1 routine uses
- // including the padding.
- var padlen = function (len) {
- for (len += 9; len % 64 > 0; len += 1);
- return len;
- };
-
- var padZeroes = function (bin, len) {
- var h8 = new Uint8Array(bin.buffer);
- var om = len % 4, align = len - om;
- switch (om) {
- case 0: h8[align + 3] = 0;
- case 1: h8[align + 2] = 0;
- case 2: h8[align + 1] = 0;
- case 3: h8[align + 0] = 0;
- }
- for (var i = (len >> 2) + 1; i < bin.length; i++)
- bin[i] = 0;
- };
-
- var padData = function (bin, chunkLen, msgLen) {
- bin[chunkLen>>2] |= 0x80 << (24 - (chunkLen % 4 << 3));
- // To support msgLen >= 2 GiB, use a float division when computing the
- // high 32-bits of the big-endian message length in bits.
- bin[(((chunkLen >> 2) + 2) & ~0x0f) + 14] = (msgLen / (1 << 29)) |0;
- bin[(((chunkLen >> 2) + 2) & ~0x0f) + 15] = msgLen << 3;
- };
-
- // Convert a binary string and write it to the heap.
- // A binary string is expected to only contain char codes < 256.
- var convStr = function (H8, H32, start, len, off) {
- var str = this, i, om = off % 4, lm = (len + om) % 4, j = len - lm;
- switch (om) {
- case 0: H8[off] = str.charCodeAt(start+3);
- case 1: H8[off+1-(om<<1)|0] = str.charCodeAt(start+2);
- case 2: H8[off+2-(om<<1)|0] = str.charCodeAt(start+1);
- case 3: H8[off+3-(om<<1)|0] = str.charCodeAt(start);
- }
- if (len < lm + om) {
- return;
- }
- for (i = 4 - om; i < j; i = i + 4 | 0) {
- H32[off+i>>2] = str.charCodeAt(start+i) << 24 |
- str.charCodeAt(start+i+1) << 16 |
- str.charCodeAt(start+i+2) << 8 |
- str.charCodeAt(start+i+3);
- }
- switch (lm) {
- case 3: H8[off+j+1|0] = str.charCodeAt(start+j+2);
- case 2: H8[off+j+2|0] = str.charCodeAt(start+j+1);
- case 1: H8[off+j+3|0] = str.charCodeAt(start+j);
- }
- };
-
- // Convert a buffer or array and write it to the heap.
- // The buffer or array is expected to only contain elements < 256.
- var convBuf = function (H8, H32, start, len, off) {
- var buf = this, i, om = off % 4, lm = (len + om) % 4, j = len - lm;
- switch (om) {
- case 0: H8[off] = buf[start + 3];
- case 1: H8[off+1-(om<<1)|0] = buf[start+2];
- case 2: H8[off+2-(om<<1)|0] = buf[start+1];
- case 3: H8[off+3-(om<<1)|0] = buf[start];
- }
- if (len < lm + om) {
- return;
- }
- for (i = 4 - om; i < j; i = i + 4 | 0) {
- H32[off+i>>2|0] = buf[start+i] << 24 |
- buf[start+i+1] << 16 |
- buf[start+i+2] << 8 |
- buf[start+i+3];
- }
- switch (lm) {
- case 3: H8[off+j+1|0] = buf[start+j+2];
- case 2: H8[off+j+2|0] = buf[start+j+1];
- case 1: H8[off+j+3|0] = buf[start+j];
- }
- };
-
- var convBlob = function (H8, H32, start, len, off) {
- var blob = this, i, om = off % 4, lm = (len + om) % 4, j = len - lm;
- var buf = new Uint8Array(reader.readAsArrayBuffer(blob.slice(start, start + len)));
- switch (om) {
- case 0: H8[off] = buf[3];
- case 1: H8[off+1-(om<<1)|0] = buf[2];
- case 2: H8[off+2-(om<<1)|0] = buf[1];
- case 3: H8[off+3-(om<<1)|0] = buf[0];
- }
- if (len < lm + om) {
- return;
- }
- for (i = 4 - om; i < j; i = i + 4 | 0) {
- H32[off+i>>2|0] = buf[i] << 24 |
- buf[i+1] << 16 |
- buf[i+2] << 8 |
- buf[i+3];
- }
- switch (lm) {
- case 3: H8[off+j+1|0] = buf[j + 2];
- case 2: H8[off+j+2|0] = buf[j + 1];
- case 1: H8[off+j+3|0] = buf[j];
- }
- };
-
- var convFn = function (data) {
- switch (getDataType(data)) {
- case 'string': return convStr.bind(data);
- case 'array': return convBuf.bind(data);
- case 'buffer': return convBuf.bind(data);
- case 'arraybuffer': return convBuf.bind(new Uint8Array(data));
- case 'view': return convBuf.bind(new Uint8Array(data.buffer, data.byteOffset, data.byteLength));
- case 'blob': return convBlob.bind(data);
- }
- };
-
- // Initialize the internal data structures to a new capacity.
- var init = function (size) {
- if (size % 64 > 0) {
- throw new Error('Chunk size must be a multiple of 128 bit');
- }
- self.offset = 0;
- self.maxChunkLen = size;
- self.padMaxChunkLen = padlen(size);
- // The size of the heap is the sum of:
- // 1. The padded input message size
- // 2. The extended space the algorithm needs (320 byte)
- // 3. The 160 bit state the algoritm uses
- self.heap = new ArrayBuffer(utils.ceilHeapSize(self.padMaxChunkLen + 320 + 20));
- self.h32 = new Int32Array(self.heap);
- self.h8 = new Int8Array(self.heap);
- self.core = new RushaCore({Int32Array: Int32Array}, {}, self.heap);
- self.buffer = null;
- };
-
- // Iinitializethe datastructures according
- // to a chunk siyze.
- init(chunkSize || 64 * 1024);
-
- var initState = function (heap, padMsgLen) {
- self.offset = 0;
- var io = new Int32Array(heap, padMsgLen + 320, 5);
- io[0] = 1732584193;
- io[1] = -271733879;
- io[2] = -1732584194;
- io[3] = 271733878;
- io[4] = -1009589776;
- };
-
- var padChunk = function (chunkLen, msgLen) {
- var padChunkLen = padlen(chunkLen);
- var view = new Int32Array(self.heap, 0, padChunkLen >> 2);
- padZeroes(view, chunkLen);
- padData(view, chunkLen, msgLen);
- return padChunkLen;
- };
-
- // Write data to the heap.
- var write = function (data, chunkOffset, chunkLen, off) {
- convFn(data)(self.h8, self.h32, chunkOffset, chunkLen, off || 0);
- };
-
- // Initialize and call the RushaCore,
- // assuming an input buffer of length len * 4.
- var coreCall = function (data, chunkOffset, chunkLen, msgLen, finalize) {
- var padChunkLen = chunkLen;
- write(data, chunkOffset, chunkLen);
- if (finalize) {
- padChunkLen = padChunk(chunkLen, msgLen);
- }
- self.core.hash(padChunkLen, self.padMaxChunkLen);
- };
-
- var getRawDigest = function (heap, padMaxChunkLen) {
- var io = new Int32Array(heap, padMaxChunkLen + 320, 5);
- var out = new Int32Array(5);
- var arr = new DataView(out.buffer);
- arr.setInt32(0, io[0], false);
- arr.setInt32(4, io[1], false);
- arr.setInt32(8, io[2], false);
- arr.setInt32(12, io[3], false);
- arr.setInt32(16, io[4], false);
- return out;
- };
-
- // Calculate the hash digest as an array of 5 32bit integers.
- var rawDigest = this.rawDigest = function (str) {
- var msgLen = str.byteLength || str.length || str.size || 0;
- initState(self.heap, self.padMaxChunkLen);
- var chunkOffset = 0, chunkLen = self.maxChunkLen;
- for (chunkOffset = 0; msgLen > chunkOffset + chunkLen; chunkOffset += chunkLen) {
- coreCall(str, chunkOffset, chunkLen, msgLen, false);
- }
- coreCall(str, chunkOffset, msgLen - chunkOffset, msgLen, true);
- return getRawDigest(self.heap, self.padMaxChunkLen);
- };
-
- // The digest and digestFrom* interface returns the hash digest
- // as a hex string.
- this.digest = this.digestFromString =
- this.digestFromBuffer = this.digestFromArrayBuffer =
- function (str) {
- return utils.toHex(rawDigest(str).buffer);
- };
-
- this.resetState = function () {
- initState(self.heap, self.padMaxChunkLen);
- return this;
- };
-
- this.append = function (chunk) {
- var chunkOffset = 0;
- var chunkLen = chunk.byteLength || chunk.length || chunk.size || 0;
- var turnOffset = self.offset % self.maxChunkLen;
- var inputLen;
-
- self.offset += chunkLen;
- while (chunkOffset < chunkLen) {
- inputLen = Math.min(chunkLen - chunkOffset, self.maxChunkLen - turnOffset);
- write(chunk, chunkOffset, inputLen, turnOffset);
- turnOffset += inputLen;
- chunkOffset += inputLen;
- if (turnOffset === self.maxChunkLen) {
- self.core.hash(self.maxChunkLen, self.padMaxChunkLen);
- turnOffset = 0;
- }
- }
- return this;
- };
-
- this.getState = function () {
- var turnOffset = self.offset % self.maxChunkLen;
- var heap;
- if (!turnOffset) {
- var io = new Int32Array(self.heap, self.padMaxChunkLen + 320, 5);
- heap = io.buffer.slice(io.byteOffset, io.byteOffset + io.byteLength);
- } else {
- heap = self.heap.slice(0);
- }
- return {
- offset: self.offset,
- heap: heap
- };
- };
-
- this.setState = function (state) {
- self.offset = state.offset;
- if (state.heap.byteLength === 20) {
- var io = new Int32Array(self.heap, self.padMaxChunkLen + 320, 5);
- io.set(new Int32Array(state.heap));
- } else {
- self.h32.set(new Int32Array(state.heap));
- }
- return this;
- };
-
- var rawEnd = this.rawEnd = function () {
- var msgLen = self.offset;
- var chunkLen = msgLen % self.maxChunkLen;
- var padChunkLen = padChunk(chunkLen, msgLen);
- self.core.hash(padChunkLen, self.padMaxChunkLen);
- var result = getRawDigest(self.heap, self.padMaxChunkLen);
- initState(self.heap, self.padMaxChunkLen);
- return result;
- };
-
- this.end = function () {
- return utils.toHex(rawEnd().buffer);
- };
-};
-
-module.exports._core = RushaCore;
-
-// If we're running in a webworker, accept
-// messages containing a jobid and a buffer
-// or blob object, and return the hash result.
-Iif (typeof self.FileReaderSync !== 'undefined') {
- var reader = new self.FileReaderSync();
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./core.sjs":2,"./utils":6}],6:[function(require,module,exports){
-'use strict';
-
-/* eslint-env commonjs, browser */
-
-//
-// toHex
-//
-
-var precomputedHex = new Array(256);
-for (var i = 0; i < 256; i++) {
- precomputedHex[i] = (i < 0x10 ? '0' : '') + i.toString(16);
-}
-
-module.exports.toHex = function (arrayBuffer) {
- var binarray = new Uint8Array(arrayBuffer);
- var res = new Array(arrayBuffer.byteLength);
- for (var i = 0; i < res.length; i++) {
- res[i] = precomputedHex[binarray[i]];
- }
- return res.join('');
-};
-
-//
-// ceilHeapSize
-//
-
-module.exports.ceilHeapSize = function (v) {
- // The asm.js spec says:
- // The heap object's byteLength must be either
- // 2^n for n in [12, 24) or 2^24 * n for n ≥ 1.
- // Also, byteLengths smaller than 2^16 are deprecated.
- var p;
- // If v is smaller than 2^16, the smallest possible solution
- // is 2^16.
- if (v <= 65536) return 65536;
- // If v < 2^24, we round up to 2^n,
- // otherwise we round up to 2^24 * n.
- if (v < 16777216) {
- for (p = 1; p < v; p = p << 1);
- } else {
- for (p = 16777216; p < v; p += 16777216);
- }
- return p;
-};
-
-},{}],7:[function(require,module,exports){
-'use strict';
-
-/* eslint-env commonjs, worker */
-
-module.exports = function worker() {
- var Rusha = require('./rusha.js');
-
- var hashData = function hashData (hasher, data, cb) {
- try {
- return cb(null, hasher.digest(data));
- } catch (e) {
- return cb(e);
- }
- };
-
- var hashFile = function hashFile (hasher, readTotal, blockSize, file, cb) {
- var reader = new self.FileReader();
- reader.onloadend = function onloadend () {
- if (reader.error) {
- return cb(reader.error);
- }
- var buffer = reader.result;
- readTotal += reader.result.byteLength;
- try {
- hasher.append(buffer);
- }
- catch (e) {
- cb(e);
- return;
- }
- if (readTotal < file.size) {
- hashFile(hasher, readTotal, blockSize, file, cb);
- } else {
- cb(null, hasher.end());
- }
- };
- reader.readAsArrayBuffer(file.slice(readTotal, readTotal + blockSize));
- };
-
- var workerBehaviourEnabled = true;
-
- self.onmessage = function onMessage (event) {
- if (!workerBehaviourEnabled) {
- return;
- }
-
- var data = event.data.data, file = event.data.file, id = event.data.id;
- if (typeof id === 'undefined') return;
- if (!file && !data) return;
- var blockSize = event.data.blockSize || (4 * 1024 * 1024);
- var hasher = new Rusha(blockSize);
- hasher.resetState();
- var done = function done (err, hash) {
- if (!err) {
- self.postMessage({id: id, hash: hash});
- } else {
- self.postMessage({id: id, error: err.name});
- }
- };
- if (data) hashData(hasher, data, done);
- if (file) hashFile(hasher, 0, blockSize, file, done);
- };
-
- return function disableWorkerBehaviour() {
- workerBehaviourEnabled = false;
- };
-};
-
-},{"./rusha.js":5}]},{},[4])(4)
-}); |
| 1 -2 -3 | - -256× | /*! rusha 2017-11-26 */
-
-(function(e){Iif(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else Iif(typeof define==="function"&&define.amd){define([],e)}else{var r;Eif(typeof window!=="undefined"){r=window}else if(typeof global!=="undefined"){r=global}else if(typeof self!=="undefined"){r=self}else{r=this}r.Rusha=e()}})(function(){var e,r,t;return function e(r,t,n){function a(i,o){if(!t[i]){Iif(!r[i]){var s=typeof require=="function"&&require;if(!o&&s)return s(i,!0);if(f)return f(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var c=t[i]={exports:{}};r[i][0].call(c.exports,function(e){var t=r[i][1][e];return a(t?t:e)},c,c.exports,e,r,t,n)}return t[i].exports}var f=typeof require=="function"&&require;for(var i=0;i<n.length;i++)a(n[i]);return a}({1:[function(e,r,t){var n=arguments[3];var a=arguments[4];var f=arguments[5];var i=JSON.stringify;r.exports=function(e,r){var t;var o=Object.keys(f);for(var s=0,u=o.length;s<u;s++){var c=o[s];var h=f[c].exports;if(h===e||h&&h.default===e){t=c;break}}if(!t){t=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var d={};for(var s=0,u=o.length;s<u;s++){var c=o[s];d[c]=c}a[t]=["function(require,module,exports){"+e+"(self); }",d]}var v=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var l={};l[t]=t;a[v]=["function(require,module,exports){"+"var f = require("+i(t)+");"+"(f.default ? f.default : f)(self);"+"}",l];var p={};w(v);function w(e){p[e]=true;for(var r in a[e][1]){var t=a[e][1][r];if(!p[t]){w(t)}}}var y="("+n+")({"+Object.keys(p).map(function(e){return i(e)+":["+a[e][0]+","+i(a[e][1])+"]"}).join(",")+"},{},["+i(v)+"])";var b=window.URL||window.webkitURL||window.mozURL||window.msURL;var x=new Blob([y],{type:"text/javascript"});if(r&&r.bare){return x}var A=b.createObjectURL(x);var g=new Worker(A);g.objectURL=A;return g}},{}],2:[function(e,r,t){r.exports=function e(r,t,n){"use asm";var a=new r.Int32Array(n);function f(e,r){e=e|0;r=r|0;var t=0,n=0,f=0,i=0,o=0,s=0,u=0,c=0,h=0,d=0,v=0,l=0,p=0,w=0;f=a[r+320>>2]|0;o=a[r+324>>2]|0;u=a[r+328>>2]|0;h=a[r+332>>2]|0;v=a[r+336>>2]|0;for(t=0;(t|0)<(e|0);t=t+64|0){i=f;s=o;c=u;d=h;l=v;for(n=0;(n|0)<64;n=n+4|0){w=a[t+n>>2]|0;p=((f<<5|f>>>27)+(o&u|~o&h)|0)+((w+v|0)+1518500249|0)|0;v=h;h=u;u=o<<30|o>>>2;o=f;f=p;a[e+n>>2]=w}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){w=(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])<<1|(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])>>>31;p=((f<<5|f>>>27)+(o&u|~o&h)|0)+((w+v|0)+1518500249|0)|0;v=h;h=u;u=o<<30|o>>>2;o=f;f=p;a[n>>2]=w}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){w=(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])<<1|(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])>>>31;p=((f<<5|f>>>27)+(o^u^h)|0)+((w+v|0)+1859775393|0)|0;v=h;h=u;u=o<<30|o>>>2;o=f;f=p;a[n>>2]=w}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){w=(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])<<1|(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])>>>31;p=((f<<5|f>>>27)+(o&u|o&h|u&h)|0)+((w+v|0)-1894007588|0)|0;v=h;h=u;u=o<<30|o>>>2;o=f;f=p;a[n>>2]=w}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){w=(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])<<1|(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])>>>31;p=((f<<5|f>>>27)+(o^u^h)|0)+((w+v|0)-899497514|0)|0;v=h;h=u;u=o<<30|o>>>2;o=f;f=p;a[n>>2]=w}f=f+i|0;o=o+s|0;u=u+c|0;h=h+d|0;v=v+l|0}a[r+320>>2]=f;a[r+324>>2]=o;a[r+328>>2]=u;a[r+332>>2]=h;a[r+336>>2]=v}return{hash:f}}},{}],3:[function(e,r,t){"use strict";var n=e("./rusha.js");var a=e("./utils.js");function f(){this._rusha=new n;this._rusha.resetState()}f.prototype.update=function e(r){this._rusha.append(r);return this};f.prototype.digest=function e(r){var e=this._rusha.rawEnd().buffer;if(!r){return e}if(r==="hex"){return a.toHex(e)}throw new Error("unsupported digest encoding")};r.exports=function e(){return new f}},{"./rusha.js":5,"./utils.js":6}],4:[function(e,r,t){"use strict";var n=e("webworkify");var a=e("./rusha.js");var f=e("./hash.js");Iif(typeof FileReaderSync!=="undefined"&&typeof DedicatedWorkerGlobalScope!=="undefined"){a.disableWorkerBehaviour=e("./worker")()}else{a.disableWorkerBehaviour=function(){}}a.createWorker=function r(){var t=n(e("./worker"));var a=t.terminate;t.terminate=function(){URL.revokeObjectURL(t.objectURL);a.call(t)};return t};a.createHash=f;r.exports=a},{"./hash.js":3,"./rusha.js":5,"./worker":7,webworkify:1}],5:[function(e,r,t){(function(t){"use strict";var n=e("./core.sjs");var a=e("./utils");r.exports=function e(r){var i=function(e){if(typeof e==="string"){return"string"}if(e instanceof Array){return"array"}if(t.Buffer&&t.Buffer.isBuffer(e)){return"buffer"}if(e instanceof ArrayBuffer){return"arraybuffer"}if(e.buffer instanceof ArrayBuffer){return"view"}if(e instanceof Blob){return"blob"}throw new Error("Unsupported data type.")};var o={};var s=function(e){for(e+=9;e%64>0;e+=1);return e};var u=function(e,r){var t=new Uint8Array(e.buffer);var n=r%4,a=r-n;switch(n){case 0:t[a+3]=0;case 1:t[a+2]=0;case 2:t[a+1]=0;case 3:t[a+0]=0}for(var f=(r>>2)+1;f<e.length;f++)e[f]=0};var c=function(e,r,t){e[r>>2]|=128<<24-(r%4<<3);e[((r>>2)+2&~15)+14]=t/(1<<29)|0;e[((r>>2)+2&~15)+15]=t<<3};var h=function(e,r,t,n,a){var f=this,i,o=a%4,s=(n+o)%4,u=n-s;switch(o){case 0:e[a]=f.charCodeAt(t+3);case 1:e[a+1-(o<<1)|0]=f.charCodeAt(t+2);case 2:e[a+2-(o<<1)|0]=f.charCodeAt(t+1);case 3:e[a+3-(o<<1)|0]=f.charCodeAt(t)}if(n<s+o){return}for(i=4-o;i<u;i=i+4|0){r[a+i>>2]=f.charCodeAt(t+i)<<24|f.charCodeAt(t+i+1)<<16|f.charCodeAt(t+i+2)<<8|f.charCodeAt(t+i+3)}switch(s){case 3:e[a+u+1|0]=f.charCodeAt(t+u+2);case 2:e[a+u+2|0]=f.charCodeAt(t+u+1);case 1:e[a+u+3|0]=f.charCodeAt(t+u)}};var d=function(e,r,t,n,a){var f=this,i,o=a%4,s=(n+o)%4,u=n-s;switch(o){case 0:e[a]=f[t+3];case 1:e[a+1-(o<<1)|0]=f[t+2];case 2:e[a+2-(o<<1)|0]=f[t+1];case 3:e[a+3-(o<<1)|0]=f[t]}if(n<s+o){return}for(i=4-o;i<u;i=i+4|0){r[a+i>>2|0]=f[t+i]<<24|f[t+i+1]<<16|f[t+i+2]<<8|f[t+i+3]}switch(s){case 3:e[a+u+1|0]=f[t+u+2];case 2:e[a+u+2|0]=f[t+u+1];case 1:e[a+u+3|0]=f[t+u]}};var v=function(e,r,t,n,a){var i=this,o,s=a%4,u=(n+s)%4,c=n-u;var h=new Uint8Array(f.readAsArrayBuffer(i.slice(t,t+n)));switch(s){case 0:e[a]=h[3];case 1:e[a+1-(s<<1)|0]=h[2];case 2:e[a+2-(s<<1)|0]=h[1];case 3:e[a+3-(s<<1)|0]=h[0]}if(n<u+s){return}for(o=4-s;o<c;o=o+4|0){r[a+o>>2|0]=h[o]<<24|h[o+1]<<16|h[o+2]<<8|h[o+3]}switch(u){case 3:e[a+c+1|0]=h[c+2];case 2:e[a+c+2|0]=h[c+1];case 1:e[a+c+3|0]=h[c]}};var l=function(e){switch(i(e)){case"string":return h.bind(e);case"array":return d.bind(e);case"buffer":return d.bind(e);case"arraybuffer":return d.bind(new Uint8Array(e));case"view":return d.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return v.bind(e)}};var p=function(e){if(e%64>0){throw new Error("Chunk size must be a multiple of 128 bit")}o.offset=0;o.maxChunkLen=e;o.padMaxChunkLen=s(e);o.heap=new ArrayBuffer(a.ceilHeapSize(o.padMaxChunkLen+320+20));o.h32=new Int32Array(o.heap);o.h8=new Int8Array(o.heap);o.core=new n({Int32Array:Int32Array},{},o.heap);o.buffer=null};p(r||64*1024);var w=function(e,r){o.offset=0;var t=new Int32Array(e,r+320,5);t[0]=1732584193;t[1]=-271733879;t[2]=-1732584194;t[3]=271733878;t[4]=-1009589776};var y=function(e,r){var t=s(e);var n=new Int32Array(o.heap,0,t>>2);u(n,e);c(n,e,r);return t};var b=function(e,r,t,n){l(e)(o.h8,o.h32,r,t,n||0)};var x=function(e,r,t,n,a){var f=t;b(e,r,t);if(a){f=y(t,n)}o.core.hash(f,o.padMaxChunkLen)};var A=function(e,r){var t=new Int32Array(e,r+320,5);var n=new Int32Array(5);var a=new DataView(n.buffer);a.setInt32(0,t[0],false);a.setInt32(4,t[1],false);a.setInt32(8,t[2],false);a.setInt32(12,t[3],false);a.setInt32(16,t[4],false);return n};var g=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;w(o.heap,o.padMaxChunkLen);var t=0,n=o.maxChunkLen;for(t=0;r>t+n;t+=n){x(e,t,n,r,false)}x(e,t,r-t,r,true);return A(o.heap,o.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return a.toHex(g(e).buffer)};this.resetState=function(){w(o.heap,o.padMaxChunkLen);return this};this.append=function(e){var r=0;var t=e.byteLength||e.length||e.size||0;var n=o.offset%o.maxChunkLen;var a;o.offset+=t;while(r<t){a=Math.min(t-r,o.maxChunkLen-n);b(e,r,a,n);n+=a;r+=a;if(n===o.maxChunkLen){o.core.hash(o.maxChunkLen,o.padMaxChunkLen);n=0}}return this};this.getState=function(){var e=o.offset%o.maxChunkLen;var r;if(!e){var t=new Int32Array(o.heap,o.padMaxChunkLen+320,5);r=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}else{r=o.heap.slice(0)}return{offset:o.offset,heap:r}};this.setState=function(e){o.offset=e.offset;if(e.heap.byteLength===20){var r=new Int32Array(o.heap,o.padMaxChunkLen+320,5);r.set(new Int32Array(e.heap))}else{o.h32.set(new Int32Array(e.heap))}return this};var k=this.rawEnd=function(){var e=o.offset;var r=e%o.maxChunkLen;var t=y(r,e);o.core.hash(t,o.padMaxChunkLen);var n=A(o.heap,o.padMaxChunkLen);w(o.heap,o.padMaxChunkLen);return n};this.end=function(){return a.toHex(k().buffer)}};r.exports._core=n;Iif(typeof self.FileReaderSync!=="undefined"){var f=new self.FileReaderSync}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./core.sjs":2,"./utils":6}],6:[function(e,r,t){"use strict";var n=new Array(256);for(var a=0;a<256;a++){n[a]=(a<16?"0":"")+a.toString(16)}r.exports.toHex=function(e){var r=new Uint8Array(e);var t=new Array(e.byteLength);for(var a=0;a<t.length;a++){t[a]=n[r[a]]}return t.join("")};r.exports.ceilHeapSize=function(e){var r;if(e<=65536)return 65536;if(e<16777216){for(r=1;r<e;r=r<<1);}else{for(r=16777216;r<e;r+=16777216);}return r}},{}],7:[function(e,r,t){"use strict";r.exports=function r(){var t=e("./rusha.js");var n=function e(r,t,n){try{return n(null,r.digest(t))}catch(e){return n(e)}};var a=function e(r,t,n,a,f){var i=new self.FileReader;i.onloadend=function o(){if(i.error){return f(i.error)}var s=i.result;t+=i.result.byteLength;try{r.append(s)}catch(e){f(e);return}if(t<a.size){e(r,t,n,a,f)}else{f(null,r.end())}};i.readAsArrayBuffer(a.slice(t,t+n))};var f=true;self.onmessage=function e(r){if(!f){return}var i=r.data.data,o=r.data.file,s=r.data.id;if(typeof s==="undefined")return;if(!o&&!i)return;var u=r.data.blockSize||4*1024*1024;var c=new t(u);c.resetState();var h=function e(r,t){if(!r){self.postMessage({id:s,hash:t})}else{self.postMessage({id:s,error:r.name})}};if(i)n(c,i,h);if(o)a(c,0,u,o,h)};return function e(){f=false}}},{"./rusha.js":5}]},{},[4])(4)}); |
| File | -- | Statements | -- | Branches | -- | Functions | -- | Lines | -- |
|---|---|---|---|---|---|---|---|---|---|
| dist/ | -12.47% | -108/866 | -11.11% | -36/324 | -21.05% | -24/114 | -8.91% | -35/393 | -
| File | -- | Statements | -- | Branches | -- | Functions | -- | Lines | -- |
|---|---|---|---|---|---|---|---|---|---|
| rusha.js | -12.47% | -54/433 | -11.11% | -18/162 | -21.05% | -12/57 | -8.67% | -34/392 | -|
| rusha.min.js | -12.47% | -54/433 | -11.11% | -18/162 | -21.05% | -12/57 | -100% | -1/1 | -
| 1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 | 9× -1× -1× -1× - -1× - -1× - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1× - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1× - - -1× - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1× -1× - -1× - - - - -1× - - - - -1× - - - - - - - - - - -1× - - - - - - - - -1× - -1× -1× - - - - -1× - - -1× - - -1× - - - - - - - - - -1× - -1× - - -1× - - - - -1× -1× - - - - -1× - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1× - - - - -1× - - - - - - - - - - - - - -1× -1× -256× - - -1× - - - - - - - - - - - - -1× - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | (function(f){Iif(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else Iif(typeof define==="function"&&define.amd){define([],f)}else{var g;Eif(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Rusha = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){Iif(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-var bundleFn = arguments[3];
-var sources = arguments[4];
-var cache = arguments[5];
-
-var stringify = JSON.stringify;
-
-module.exports = function (fn, options) {
- var wkey;
- var cacheKeys = Object.keys(cache);
-
- for (var i = 0, l = cacheKeys.length; i < l; i++) {
- var key = cacheKeys[i];
- var exp = cache[key].exports;
- // Using babel as a transpiler to use esmodule, the export will always
- // be an object with the default export as a property of it. To ensure
- // the existing api and babel esmodule exports are both supported we
- // check for both
- if (exp === fn || exp && exp.default === fn) {
- wkey = key;
- break;
- }
- }
-
- if (!wkey) {
- wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);
- var wcache = {};
- for (var i = 0, l = cacheKeys.length; i < l; i++) {
- var key = cacheKeys[i];
- wcache[key] = key;
- }
- sources[wkey] = [
- 'function(require,module,exports){' + fn + '(self); }',
- wcache
- ];
- }
- var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);
-
- var scache = {}; scache[wkey] = wkey;
- sources[skey] = [
- 'function(require,module,exports){' +
- // try to call default if defined to also support babel esmodule exports
- 'var f = require(' + stringify(wkey) + ');' +
- '(f.default ? f.default : f)(self);' +
- '}',
- scache
- ];
-
- var workerSources = {};
- resolveSources(skey);
-
- function resolveSources(key) {
- workerSources[key] = true;
-
- for (var depPath in sources[key][1]) {
- var depKey = sources[key][1][depPath];
- if (!workerSources[depKey]) {
- resolveSources(depKey);
- }
- }
- }
-
- var src = '(' + bundleFn + ')({'
- + Object.keys(workerSources).map(function (key) {
- return stringify(key) + ':['
- + sources[key][0]
- + ',' + stringify(sources[key][1]) + ']'
- ;
- }).join(',')
- + '},{},[' + stringify(skey) + '])'
- ;
-
- var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
-
- var blob = new Blob([src], { type: 'text/javascript' });
- if (options && options.bare) { return blob; }
- var workerUrl = URL.createObjectURL(blob);
- var worker = new Worker(workerUrl);
- worker.objectURL = workerUrl;
- return worker;
-};
-
-},{}],2:[function(require,module,exports){
-// The low-level RushCore module provides the heart of Rusha,
-// a high-speed sha1 implementation working on an Int32Array heap.
-// At first glance, the implementation seems complicated, however
-// with the SHA1 spec at hand, it is obvious this almost a textbook
-// implementation that has a few functions hand-inlined and a few loops
-// hand-unrolled.
-module.exports = function RushaCore(stdlib$1186, foreign$1187, heap$1188) {
- 'use asm';
- var H$1189 = new stdlib$1186.Int32Array(heap$1188);
- function hash$1190(k$1191, x$1192) {
- // k in bytes
- k$1191 = k$1191 | 0;
- x$1192 = x$1192 | 0;
- var i$1193 = 0, j$1194 = 0, y0$1195 = 0, z0$1196 = 0, y1$1197 = 0, z1$1198 = 0, y2$1199 = 0, z2$1200 = 0, y3$1201 = 0, z3$1202 = 0, y4$1203 = 0, z4$1204 = 0, t0$1205 = 0, t1$1206 = 0;
- y0$1195 = H$1189[x$1192 + 320 >> 2] | 0;
- y1$1197 = H$1189[x$1192 + 324 >> 2] | 0;
- y2$1199 = H$1189[x$1192 + 328 >> 2] | 0;
- y3$1201 = H$1189[x$1192 + 332 >> 2] | 0;
- y4$1203 = H$1189[x$1192 + 336 >> 2] | 0;
- for (i$1193 = 0; (i$1193 | 0) < (k$1191 | 0); i$1193 = i$1193 + 64 | 0) {
- z0$1196 = y0$1195;
- z1$1198 = y1$1197;
- z2$1200 = y2$1199;
- z3$1202 = y3$1201;
- z4$1204 = y4$1203;
- for (j$1194 = 0; (j$1194 | 0) < 64; j$1194 = j$1194 + 4 | 0) {
- t1$1206 = H$1189[i$1193 + j$1194 >> 2] | 0;
- t0$1205 = ((y0$1195 << 5 | y0$1195 >>> 27) + (y1$1197 & y2$1199 | ~y1$1197 & y3$1201) | 0) + ((t1$1206 + y4$1203 | 0) + 1518500249 | 0) | 0;
- y4$1203 = y3$1201;
- y3$1201 = y2$1199;
- y2$1199 = y1$1197 << 30 | y1$1197 >>> 2;
- y1$1197 = y0$1195;
- y0$1195 = t0$1205;
- H$1189[k$1191 + j$1194 >> 2] = t1$1206;
- }
- for (j$1194 = k$1191 + 64 | 0; (j$1194 | 0) < (k$1191 + 80 | 0); j$1194 = j$1194 + 4 | 0) {
- t1$1206 = (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) << 1 | (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) >>> 31;
- t0$1205 = ((y0$1195 << 5 | y0$1195 >>> 27) + (y1$1197 & y2$1199 | ~y1$1197 & y3$1201) | 0) + ((t1$1206 + y4$1203 | 0) + 1518500249 | 0) | 0;
- y4$1203 = y3$1201;
- y3$1201 = y2$1199;
- y2$1199 = y1$1197 << 30 | y1$1197 >>> 2;
- y1$1197 = y0$1195;
- y0$1195 = t0$1205;
- H$1189[j$1194 >> 2] = t1$1206;
- }
- for (j$1194 = k$1191 + 80 | 0; (j$1194 | 0) < (k$1191 + 160 | 0); j$1194 = j$1194 + 4 | 0) {
- t1$1206 = (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) << 1 | (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) >>> 31;
- t0$1205 = ((y0$1195 << 5 | y0$1195 >>> 27) + (y1$1197 ^ y2$1199 ^ y3$1201) | 0) + ((t1$1206 + y4$1203 | 0) + 1859775393 | 0) | 0;
- y4$1203 = y3$1201;
- y3$1201 = y2$1199;
- y2$1199 = y1$1197 << 30 | y1$1197 >>> 2;
- y1$1197 = y0$1195;
- y0$1195 = t0$1205;
- H$1189[j$1194 >> 2] = t1$1206;
- }
- for (j$1194 = k$1191 + 160 | 0; (j$1194 | 0) < (k$1191 + 240 | 0); j$1194 = j$1194 + 4 | 0) {
- t1$1206 = (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) << 1 | (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) >>> 31;
- t0$1205 = ((y0$1195 << 5 | y0$1195 >>> 27) + (y1$1197 & y2$1199 | y1$1197 & y3$1201 | y2$1199 & y3$1201) | 0) + ((t1$1206 + y4$1203 | 0) - 1894007588 | 0) | 0;
- y4$1203 = y3$1201;
- y3$1201 = y2$1199;
- y2$1199 = y1$1197 << 30 | y1$1197 >>> 2;
- y1$1197 = y0$1195;
- y0$1195 = t0$1205;
- H$1189[j$1194 >> 2] = t1$1206;
- }
- for (j$1194 = k$1191 + 240 | 0; (j$1194 | 0) < (k$1191 + 320 | 0); j$1194 = j$1194 + 4 | 0) {
- t1$1206 = (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) << 1 | (H$1189[j$1194 - 12 >> 2] ^ H$1189[j$1194 - 32 >> 2] ^ H$1189[j$1194 - 56 >> 2] ^ H$1189[j$1194 - 64 >> 2]) >>> 31;
- t0$1205 = ((y0$1195 << 5 | y0$1195 >>> 27) + (y1$1197 ^ y2$1199 ^ y3$1201) | 0) + ((t1$1206 + y4$1203 | 0) - 899497514 | 0) | 0;
- y4$1203 = y3$1201;
- y3$1201 = y2$1199;
- y2$1199 = y1$1197 << 30 | y1$1197 >>> 2;
- y1$1197 = y0$1195;
- y0$1195 = t0$1205;
- H$1189[j$1194 >> 2] = t1$1206;
- }
- y0$1195 = y0$1195 + z0$1196 | 0;
- y1$1197 = y1$1197 + z1$1198 | 0;
- y2$1199 = y2$1199 + z2$1200 | 0;
- y3$1201 = y3$1201 + z3$1202 | 0;
- y4$1203 = y4$1203 + z4$1204 | 0;
- }
- H$1189[x$1192 + 320 >> 2] = y0$1195;
- H$1189[x$1192 + 324 >> 2] = y1$1197;
- H$1189[x$1192 + 328 >> 2] = y2$1199;
- H$1189[x$1192 + 332 >> 2] = y3$1201;
- H$1189[x$1192 + 336 >> 2] = y4$1203;
- }
- return { hash: hash$1190 };
-};
-
-},{}],3:[function(require,module,exports){
-'use strict';
-
-/* eslint-env commonjs, browser */
-
-var Rusha = require('./rusha.js');
-var utils = require('./utils.js');
-
-function Hash() {
- this._rusha = new Rusha();
- this._rusha.resetState();
-}
-
-Hash.prototype.update = function update(data) {
- this._rusha.append(data);
- return this;
-};
-
-Hash.prototype.digest = function digest(encoding) {
- var digest = this._rusha.rawEnd().buffer;
- if (!encoding) {
- return digest;
- }
- if (encoding === 'hex') {
- return utils.toHex(digest);
- }
- throw new Error('unsupported digest encoding');
-};
-
-module.exports = function createHash() {
- return new Hash();
-};
-
-},{"./rusha.js":5,"./utils.js":6}],4:[function(require,module,exports){
-'use strict';
-
-/* eslint-env commonjs, browser */
-
-var webworkify = require('webworkify');
-
-var Rusha = require('./rusha.js');
-var createHash = require('./hash.js');
-
-// If we're running in a webworker, accept
-// messages containing a jobid and a buffer
-// or blob object, and return the hash result.
-Iif (typeof FileReaderSync !== 'undefined' && typeof DedicatedWorkerGlobalScope !== 'undefined') {
- Rusha.disableWorkerBehaviour = require('./worker')();
-} else {
- Rusha.disableWorkerBehaviour = function () {};
-}
-
-Rusha.createWorker = function createWorker() {
- var worker = webworkify(require('./worker'));
- var terminate = worker.terminate;
- worker.terminate = function () {
- URL.revokeObjectURL(worker.objectURL);
- terminate.call(worker);
- };
- return worker;
-};
-
-Rusha.createHash = createHash;
-
-module.exports = Rusha;
-
-},{"./hash.js":3,"./rusha.js":5,"./worker":7,"webworkify":1}],5:[function(require,module,exports){
-(function (global){
-'use strict';
-
-/* eslint-env commonjs, browser */
-
-var RushaCore = require('./core.sjs');
-var utils = require('./utils');
-
-// The Rusha object is a wrapper around the low-level RushaCore.
-// It provides means of converting different inputs to the
-// format accepted by RushaCore as well as other utility methods.
-module.exports = function Rusha (chunkSize) {
- var getDataType = function (data) {
- if (typeof data === 'string') {
- return 'string';
- }
- if (data instanceof Array) {
- return 'array';
- }
- if (global.Buffer && global.Buffer.isBuffer(data)) {
- return 'buffer';
- }
- if (data instanceof ArrayBuffer) {
- return 'arraybuffer';
- }
- if (data.buffer instanceof ArrayBuffer) {
- return 'view';
- }
- if (data instanceof Blob) {
- return 'blob';
- }
- throw new Error('Unsupported data type.');
- };
-
- // Private object structure.
- var self = {};
-
- // Calculate the length of buffer that the sha1 routine uses
- // including the padding.
- var padlen = function (len) {
- for (len += 9; len % 64 > 0; len += 1);
- return len;
- };
-
- var padZeroes = function (bin, len) {
- var h8 = new Uint8Array(bin.buffer);
- var om = len % 4, align = len - om;
- switch (om) {
- case 0: h8[align + 3] = 0;
- case 1: h8[align + 2] = 0;
- case 2: h8[align + 1] = 0;
- case 3: h8[align + 0] = 0;
- }
- for (var i = (len >> 2) + 1; i < bin.length; i++)
- bin[i] = 0;
- };
-
- var padData = function (bin, chunkLen, msgLen) {
- bin[chunkLen>>2] |= 0x80 << (24 - (chunkLen % 4 << 3));
- // To support msgLen >= 2 GiB, use a float division when computing the
- // high 32-bits of the big-endian message length in bits.
- bin[(((chunkLen >> 2) + 2) & ~0x0f) + 14] = (msgLen / (1 << 29)) |0;
- bin[(((chunkLen >> 2) + 2) & ~0x0f) + 15] = msgLen << 3;
- };
-
- // Convert a binary string and write it to the heap.
- // A binary string is expected to only contain char codes < 256.
- var convStr = function (H8, H32, start, len, off) {
- var str = this, i, om = off % 4, lm = (len + om) % 4, j = len - lm;
- switch (om) {
- case 0: H8[off] = str.charCodeAt(start+3);
- case 1: H8[off+1-(om<<1)|0] = str.charCodeAt(start+2);
- case 2: H8[off+2-(om<<1)|0] = str.charCodeAt(start+1);
- case 3: H8[off+3-(om<<1)|0] = str.charCodeAt(start);
- }
- if (len < lm + om) {
- return;
- }
- for (i = 4 - om; i < j; i = i + 4 | 0) {
- H32[off+i>>2] = str.charCodeAt(start+i) << 24 |
- str.charCodeAt(start+i+1) << 16 |
- str.charCodeAt(start+i+2) << 8 |
- str.charCodeAt(start+i+3);
- }
- switch (lm) {
- case 3: H8[off+j+1|0] = str.charCodeAt(start+j+2);
- case 2: H8[off+j+2|0] = str.charCodeAt(start+j+1);
- case 1: H8[off+j+3|0] = str.charCodeAt(start+j);
- }
- };
-
- // Convert a buffer or array and write it to the heap.
- // The buffer or array is expected to only contain elements < 256.
- var convBuf = function (H8, H32, start, len, off) {
- var buf = this, i, om = off % 4, lm = (len + om) % 4, j = len - lm;
- switch (om) {
- case 0: H8[off] = buf[start + 3];
- case 1: H8[off+1-(om<<1)|0] = buf[start+2];
- case 2: H8[off+2-(om<<1)|0] = buf[start+1];
- case 3: H8[off+3-(om<<1)|0] = buf[start];
- }
- if (len < lm + om) {
- return;
- }
- for (i = 4 - om; i < j; i = i + 4 | 0) {
- H32[off+i>>2|0] = buf[start+i] << 24 |
- buf[start+i+1] << 16 |
- buf[start+i+2] << 8 |
- buf[start+i+3];
- }
- switch (lm) {
- case 3: H8[off+j+1|0] = buf[start+j+2];
- case 2: H8[off+j+2|0] = buf[start+j+1];
- case 1: H8[off+j+3|0] = buf[start+j];
- }
- };
-
- var convBlob = function (H8, H32, start, len, off) {
- var blob = this, i, om = off % 4, lm = (len + om) % 4, j = len - lm;
- var buf = new Uint8Array(reader.readAsArrayBuffer(blob.slice(start, start + len)));
- switch (om) {
- case 0: H8[off] = buf[3];
- case 1: H8[off+1-(om<<1)|0] = buf[2];
- case 2: H8[off+2-(om<<1)|0] = buf[1];
- case 3: H8[off+3-(om<<1)|0] = buf[0];
- }
- if (len < lm + om) {
- return;
- }
- for (i = 4 - om; i < j; i = i + 4 | 0) {
- H32[off+i>>2|0] = buf[i] << 24 |
- buf[i+1] << 16 |
- buf[i+2] << 8 |
- buf[i+3];
- }
- switch (lm) {
- case 3: H8[off+j+1|0] = buf[j + 2];
- case 2: H8[off+j+2|0] = buf[j + 1];
- case 1: H8[off+j+3|0] = buf[j];
- }
- };
-
- var convFn = function (data) {
- switch (getDataType(data)) {
- case 'string': return convStr.bind(data);
- case 'array': return convBuf.bind(data);
- case 'buffer': return convBuf.bind(data);
- case 'arraybuffer': return convBuf.bind(new Uint8Array(data));
- case 'view': return convBuf.bind(new Uint8Array(data.buffer, data.byteOffset, data.byteLength));
- case 'blob': return convBlob.bind(data);
- }
- };
-
- // Initialize the internal data structures to a new capacity.
- var init = function (size) {
- if (size % 64 > 0) {
- throw new Error('Chunk size must be a multiple of 128 bit');
- }
- self.offset = 0;
- self.maxChunkLen = size;
- self.padMaxChunkLen = padlen(size);
- // The size of the heap is the sum of:
- // 1. The padded input message size
- // 2. The extended space the algorithm needs (320 byte)
- // 3. The 160 bit state the algoritm uses
- self.heap = new ArrayBuffer(utils.ceilHeapSize(self.padMaxChunkLen + 320 + 20));
- self.h32 = new Int32Array(self.heap);
- self.h8 = new Int8Array(self.heap);
- self.core = new RushaCore({Int32Array: Int32Array}, {}, self.heap);
- self.buffer = null;
- };
-
- // Iinitializethe datastructures according
- // to a chunk siyze.
- init(chunkSize || 64 * 1024);
-
- var initState = function (heap, padMsgLen) {
- self.offset = 0;
- var io = new Int32Array(heap, padMsgLen + 320, 5);
- io[0] = 1732584193;
- io[1] = -271733879;
- io[2] = -1732584194;
- io[3] = 271733878;
- io[4] = -1009589776;
- };
-
- var padChunk = function (chunkLen, msgLen) {
- var padChunkLen = padlen(chunkLen);
- var view = new Int32Array(self.heap, 0, padChunkLen >> 2);
- padZeroes(view, chunkLen);
- padData(view, chunkLen, msgLen);
- return padChunkLen;
- };
-
- // Write data to the heap.
- var write = function (data, chunkOffset, chunkLen, off) {
- convFn(data)(self.h8, self.h32, chunkOffset, chunkLen, off || 0);
- };
-
- // Initialize and call the RushaCore,
- // assuming an input buffer of length len * 4.
- var coreCall = function (data, chunkOffset, chunkLen, msgLen, finalize) {
- var padChunkLen = chunkLen;
- write(data, chunkOffset, chunkLen);
- if (finalize) {
- padChunkLen = padChunk(chunkLen, msgLen);
- }
- self.core.hash(padChunkLen, self.padMaxChunkLen);
- };
-
- var getRawDigest = function (heap, padMaxChunkLen) {
- var io = new Int32Array(heap, padMaxChunkLen + 320, 5);
- var out = new Int32Array(5);
- var arr = new DataView(out.buffer);
- arr.setInt32(0, io[0], false);
- arr.setInt32(4, io[1], false);
- arr.setInt32(8, io[2], false);
- arr.setInt32(12, io[3], false);
- arr.setInt32(16, io[4], false);
- return out;
- };
-
- // Calculate the hash digest as an array of 5 32bit integers.
- var rawDigest = this.rawDigest = function (str) {
- var msgLen = str.byteLength || str.length || str.size || 0;
- initState(self.heap, self.padMaxChunkLen);
- var chunkOffset = 0, chunkLen = self.maxChunkLen;
- for (chunkOffset = 0; msgLen > chunkOffset + chunkLen; chunkOffset += chunkLen) {
- coreCall(str, chunkOffset, chunkLen, msgLen, false);
- }
- coreCall(str, chunkOffset, msgLen - chunkOffset, msgLen, true);
- return getRawDigest(self.heap, self.padMaxChunkLen);
- };
-
- // The digest and digestFrom* interface returns the hash digest
- // as a hex string.
- this.digest = this.digestFromString =
- this.digestFromBuffer = this.digestFromArrayBuffer =
- function (str) {
- return utils.toHex(rawDigest(str).buffer);
- };
-
- this.resetState = function () {
- initState(self.heap, self.padMaxChunkLen);
- return this;
- };
-
- this.append = function (chunk) {
- var chunkOffset = 0;
- var chunkLen = chunk.byteLength || chunk.length || chunk.size || 0;
- var turnOffset = self.offset % self.maxChunkLen;
- var inputLen;
-
- self.offset += chunkLen;
- while (chunkOffset < chunkLen) {
- inputLen = Math.min(chunkLen - chunkOffset, self.maxChunkLen - turnOffset);
- write(chunk, chunkOffset, inputLen, turnOffset);
- turnOffset += inputLen;
- chunkOffset += inputLen;
- if (turnOffset === self.maxChunkLen) {
- self.core.hash(self.maxChunkLen, self.padMaxChunkLen);
- turnOffset = 0;
- }
- }
- return this;
- };
-
- this.getState = function () {
- var turnOffset = self.offset % self.maxChunkLen;
- var heap;
- if (!turnOffset) {
- var io = new Int32Array(self.heap, self.padMaxChunkLen + 320, 5);
- heap = io.buffer.slice(io.byteOffset, io.byteOffset + io.byteLength);
- } else {
- heap = self.heap.slice(0);
- }
- return {
- offset: self.offset,
- heap: heap
- };
- };
-
- this.setState = function (state) {
- self.offset = state.offset;
- if (state.heap.byteLength === 20) {
- var io = new Int32Array(self.heap, self.padMaxChunkLen + 320, 5);
- io.set(new Int32Array(state.heap));
- } else {
- self.h32.set(new Int32Array(state.heap));
- }
- return this;
- };
-
- var rawEnd = this.rawEnd = function () {
- var msgLen = self.offset;
- var chunkLen = msgLen % self.maxChunkLen;
- var padChunkLen = padChunk(chunkLen, msgLen);
- self.core.hash(padChunkLen, self.padMaxChunkLen);
- var result = getRawDigest(self.heap, self.padMaxChunkLen);
- initState(self.heap, self.padMaxChunkLen);
- return result;
- };
-
- this.end = function () {
- return utils.toHex(rawEnd().buffer);
- };
-};
-
-module.exports._core = RushaCore;
-
-// If we're running in a webworker, accept
-// messages containing a jobid and a buffer
-// or blob object, and return the hash result.
-Iif (typeof self.FileReaderSync !== 'undefined') {
- var reader = new self.FileReaderSync();
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./core.sjs":2,"./utils":6}],6:[function(require,module,exports){
-'use strict';
-
-/* eslint-env commonjs, browser */
-
-//
-// toHex
-//
-
-var precomputedHex = new Array(256);
-for (var i = 0; i < 256; i++) {
- precomputedHex[i] = (i < 0x10 ? '0' : '') + i.toString(16);
-}
-
-module.exports.toHex = function (arrayBuffer) {
- var binarray = new Uint8Array(arrayBuffer);
- var res = new Array(arrayBuffer.byteLength);
- for (var i = 0; i < res.length; i++) {
- res[i] = precomputedHex[binarray[i]];
- }
- return res.join('');
-};
-
-//
-// ceilHeapSize
-//
-
-module.exports.ceilHeapSize = function (v) {
- // The asm.js spec says:
- // The heap object's byteLength must be either
- // 2^n for n in [12, 24) or 2^24 * n for n ≥ 1.
- // Also, byteLengths smaller than 2^16 are deprecated.
- var p;
- // If v is smaller than 2^16, the smallest possible solution
- // is 2^16.
- if (v <= 65536) return 65536;
- // If v < 2^24, we round up to 2^n,
- // otherwise we round up to 2^24 * n.
- if (v < 16777216) {
- for (p = 1; p < v; p = p << 1);
- } else {
- for (p = 16777216; p < v; p += 16777216);
- }
- return p;
-};
-
-},{}],7:[function(require,module,exports){
-'use strict';
-
-/* eslint-env commonjs, worker */
-
-module.exports = function worker() {
- var Rusha = require('./rusha.js');
-
- var hashData = function hashData (hasher, data, cb) {
- try {
- return cb(null, hasher.digest(data));
- } catch (e) {
- return cb(e);
- }
- };
-
- var hashFile = function hashFile (hasher, readTotal, blockSize, file, cb) {
- var reader = new self.FileReader();
- reader.onloadend = function onloadend () {
- if (reader.error) {
- return cb(reader.error);
- }
- var buffer = reader.result;
- readTotal += reader.result.byteLength;
- try {
- hasher.append(buffer);
- }
- catch (e) {
- cb(e);
- return;
- }
- if (readTotal < file.size) {
- hashFile(hasher, readTotal, blockSize, file, cb);
- } else {
- cb(null, hasher.end());
- }
- };
- reader.readAsArrayBuffer(file.slice(readTotal, readTotal + blockSize));
- };
-
- var workerBehaviourEnabled = true;
-
- self.onmessage = function onMessage (event) {
- if (!workerBehaviourEnabled) {
- return;
- }
-
- var data = event.data.data, file = event.data.file, id = event.data.id;
- if (typeof id === 'undefined') return;
- if (!file && !data) return;
- var blockSize = event.data.blockSize || (4 * 1024 * 1024);
- var hasher = new Rusha(blockSize);
- hasher.resetState();
- var done = function done (err, hash) {
- if (!err) {
- self.postMessage({id: id, hash: hash});
- } else {
- self.postMessage({id: id, error: err.name});
- }
- };
- if (data) hashData(hasher, data, done);
- if (file) hashFile(hasher, 0, blockSize, file, done);
- };
-
- return function disableWorkerBehaviour() {
- workerBehaviourEnabled = false;
- };
-};
-
-},{"./rusha.js":5}]},{},[4])(4)
-}); |
| 1 -2 -3 | - -256× | /*! rusha 2017-11-26 */
-
-(function(e){Iif(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else Iif(typeof define==="function"&&define.amd){define([],e)}else{var r;Eif(typeof window!=="undefined"){r=window}else if(typeof global!=="undefined"){r=global}else if(typeof self!=="undefined"){r=self}else{r=this}r.Rusha=e()}})(function(){var e,r,t;return function e(r,t,n){function a(i,o){if(!t[i]){Iif(!r[i]){var s=typeof require=="function"&&require;if(!o&&s)return s(i,!0);if(f)return f(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var c=t[i]={exports:{}};r[i][0].call(c.exports,function(e){var t=r[i][1][e];return a(t?t:e)},c,c.exports,e,r,t,n)}return t[i].exports}var f=typeof require=="function"&&require;for(var i=0;i<n.length;i++)a(n[i]);return a}({1:[function(e,r,t){var n=arguments[3];var a=arguments[4];var f=arguments[5];var i=JSON.stringify;r.exports=function(e,r){var t;var o=Object.keys(f);for(var s=0,u=o.length;s<u;s++){var c=o[s];var h=f[c].exports;if(h===e||h&&h.default===e){t=c;break}}if(!t){t=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var d={};for(var s=0,u=o.length;s<u;s++){var c=o[s];d[c]=c}a[t]=["function(require,module,exports){"+e+"(self); }",d]}var v=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var l={};l[t]=t;a[v]=["function(require,module,exports){"+"var f = require("+i(t)+");"+"(f.default ? f.default : f)(self);"+"}",l];var p={};w(v);function w(e){p[e]=true;for(var r in a[e][1]){var t=a[e][1][r];if(!p[t]){w(t)}}}var y="("+n+")({"+Object.keys(p).map(function(e){return i(e)+":["+a[e][0]+","+i(a[e][1])+"]"}).join(",")+"},{},["+i(v)+"])";var b=window.URL||window.webkitURL||window.mozURL||window.msURL;var x=new Blob([y],{type:"text/javascript"});if(r&&r.bare){return x}var A=b.createObjectURL(x);var g=new Worker(A);g.objectURL=A;return g}},{}],2:[function(e,r,t){r.exports=function e(r,t,n){"use asm";var a=new r.Int32Array(n);function f(e,r){e=e|0;r=r|0;var t=0,n=0,f=0,i=0,o=0,s=0,u=0,c=0,h=0,d=0,v=0,l=0,p=0,w=0;f=a[r+320>>2]|0;o=a[r+324>>2]|0;u=a[r+328>>2]|0;h=a[r+332>>2]|0;v=a[r+336>>2]|0;for(t=0;(t|0)<(e|0);t=t+64|0){i=f;s=o;c=u;d=h;l=v;for(n=0;(n|0)<64;n=n+4|0){w=a[t+n>>2]|0;p=((f<<5|f>>>27)+(o&u|~o&h)|0)+((w+v|0)+1518500249|0)|0;v=h;h=u;u=o<<30|o>>>2;o=f;f=p;a[e+n>>2]=w}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){w=(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])<<1|(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])>>>31;p=((f<<5|f>>>27)+(o&u|~o&h)|0)+((w+v|0)+1518500249|0)|0;v=h;h=u;u=o<<30|o>>>2;o=f;f=p;a[n>>2]=w}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){w=(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])<<1|(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])>>>31;p=((f<<5|f>>>27)+(o^u^h)|0)+((w+v|0)+1859775393|0)|0;v=h;h=u;u=o<<30|o>>>2;o=f;f=p;a[n>>2]=w}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){w=(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])<<1|(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])>>>31;p=((f<<5|f>>>27)+(o&u|o&h|u&h)|0)+((w+v|0)-1894007588|0)|0;v=h;h=u;u=o<<30|o>>>2;o=f;f=p;a[n>>2]=w}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){w=(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])<<1|(a[n-12>>2]^a[n-32>>2]^a[n-56>>2]^a[n-64>>2])>>>31;p=((f<<5|f>>>27)+(o^u^h)|0)+((w+v|0)-899497514|0)|0;v=h;h=u;u=o<<30|o>>>2;o=f;f=p;a[n>>2]=w}f=f+i|0;o=o+s|0;u=u+c|0;h=h+d|0;v=v+l|0}a[r+320>>2]=f;a[r+324>>2]=o;a[r+328>>2]=u;a[r+332>>2]=h;a[r+336>>2]=v}return{hash:f}}},{}],3:[function(e,r,t){"use strict";var n=e("./rusha.js");var a=e("./utils.js");function f(){this._rusha=new n;this._rusha.resetState()}f.prototype.update=function e(r){this._rusha.append(r);return this};f.prototype.digest=function e(r){var e=this._rusha.rawEnd().buffer;if(!r){return e}if(r==="hex"){return a.toHex(e)}throw new Error("unsupported digest encoding")};r.exports=function e(){return new f}},{"./rusha.js":5,"./utils.js":6}],4:[function(e,r,t){"use strict";var n=e("webworkify");var a=e("./rusha.js");var f=e("./hash.js");Iif(typeof FileReaderSync!=="undefined"&&typeof DedicatedWorkerGlobalScope!=="undefined"){a.disableWorkerBehaviour=e("./worker")()}else{a.disableWorkerBehaviour=function(){}}a.createWorker=function r(){var t=n(e("./worker"));var a=t.terminate;t.terminate=function(){URL.revokeObjectURL(t.objectURL);a.call(t)};return t};a.createHash=f;r.exports=a},{"./hash.js":3,"./rusha.js":5,"./worker":7,webworkify:1}],5:[function(e,r,t){(function(t){"use strict";var n=e("./core.sjs");var a=e("./utils");r.exports=function e(r){var i=function(e){if(typeof e==="string"){return"string"}if(e instanceof Array){return"array"}if(t.Buffer&&t.Buffer.isBuffer(e)){return"buffer"}if(e instanceof ArrayBuffer){return"arraybuffer"}if(e.buffer instanceof ArrayBuffer){return"view"}if(e instanceof Blob){return"blob"}throw new Error("Unsupported data type.")};var o={};var s=function(e){for(e+=9;e%64>0;e+=1);return e};var u=function(e,r){var t=new Uint8Array(e.buffer);var n=r%4,a=r-n;switch(n){case 0:t[a+3]=0;case 1:t[a+2]=0;case 2:t[a+1]=0;case 3:t[a+0]=0}for(var f=(r>>2)+1;f<e.length;f++)e[f]=0};var c=function(e,r,t){e[r>>2]|=128<<24-(r%4<<3);e[((r>>2)+2&~15)+14]=t/(1<<29)|0;e[((r>>2)+2&~15)+15]=t<<3};var h=function(e,r,t,n,a){var f=this,i,o=a%4,s=(n+o)%4,u=n-s;switch(o){case 0:e[a]=f.charCodeAt(t+3);case 1:e[a+1-(o<<1)|0]=f.charCodeAt(t+2);case 2:e[a+2-(o<<1)|0]=f.charCodeAt(t+1);case 3:e[a+3-(o<<1)|0]=f.charCodeAt(t)}if(n<s+o){return}for(i=4-o;i<u;i=i+4|0){r[a+i>>2]=f.charCodeAt(t+i)<<24|f.charCodeAt(t+i+1)<<16|f.charCodeAt(t+i+2)<<8|f.charCodeAt(t+i+3)}switch(s){case 3:e[a+u+1|0]=f.charCodeAt(t+u+2);case 2:e[a+u+2|0]=f.charCodeAt(t+u+1);case 1:e[a+u+3|0]=f.charCodeAt(t+u)}};var d=function(e,r,t,n,a){var f=this,i,o=a%4,s=(n+o)%4,u=n-s;switch(o){case 0:e[a]=f[t+3];case 1:e[a+1-(o<<1)|0]=f[t+2];case 2:e[a+2-(o<<1)|0]=f[t+1];case 3:e[a+3-(o<<1)|0]=f[t]}if(n<s+o){return}for(i=4-o;i<u;i=i+4|0){r[a+i>>2|0]=f[t+i]<<24|f[t+i+1]<<16|f[t+i+2]<<8|f[t+i+3]}switch(s){case 3:e[a+u+1|0]=f[t+u+2];case 2:e[a+u+2|0]=f[t+u+1];case 1:e[a+u+3|0]=f[t+u]}};var v=function(e,r,t,n,a){var i=this,o,s=a%4,u=(n+s)%4,c=n-u;var h=new Uint8Array(f.readAsArrayBuffer(i.slice(t,t+n)));switch(s){case 0:e[a]=h[3];case 1:e[a+1-(s<<1)|0]=h[2];case 2:e[a+2-(s<<1)|0]=h[1];case 3:e[a+3-(s<<1)|0]=h[0]}if(n<u+s){return}for(o=4-s;o<c;o=o+4|0){r[a+o>>2|0]=h[o]<<24|h[o+1]<<16|h[o+2]<<8|h[o+3]}switch(u){case 3:e[a+c+1|0]=h[c+2];case 2:e[a+c+2|0]=h[c+1];case 1:e[a+c+3|0]=h[c]}};var l=function(e){switch(i(e)){case"string":return h.bind(e);case"array":return d.bind(e);case"buffer":return d.bind(e);case"arraybuffer":return d.bind(new Uint8Array(e));case"view":return d.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return v.bind(e)}};var p=function(e){if(e%64>0){throw new Error("Chunk size must be a multiple of 128 bit")}o.offset=0;o.maxChunkLen=e;o.padMaxChunkLen=s(e);o.heap=new ArrayBuffer(a.ceilHeapSize(o.padMaxChunkLen+320+20));o.h32=new Int32Array(o.heap);o.h8=new Int8Array(o.heap);o.core=new n({Int32Array:Int32Array},{},o.heap);o.buffer=null};p(r||64*1024);var w=function(e,r){o.offset=0;var t=new Int32Array(e,r+320,5);t[0]=1732584193;t[1]=-271733879;t[2]=-1732584194;t[3]=271733878;t[4]=-1009589776};var y=function(e,r){var t=s(e);var n=new Int32Array(o.heap,0,t>>2);u(n,e);c(n,e,r);return t};var b=function(e,r,t,n){l(e)(o.h8,o.h32,r,t,n||0)};var x=function(e,r,t,n,a){var f=t;b(e,r,t);if(a){f=y(t,n)}o.core.hash(f,o.padMaxChunkLen)};var A=function(e,r){var t=new Int32Array(e,r+320,5);var n=new Int32Array(5);var a=new DataView(n.buffer);a.setInt32(0,t[0],false);a.setInt32(4,t[1],false);a.setInt32(8,t[2],false);a.setInt32(12,t[3],false);a.setInt32(16,t[4],false);return n};var g=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;w(o.heap,o.padMaxChunkLen);var t=0,n=o.maxChunkLen;for(t=0;r>t+n;t+=n){x(e,t,n,r,false)}x(e,t,r-t,r,true);return A(o.heap,o.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return a.toHex(g(e).buffer)};this.resetState=function(){w(o.heap,o.padMaxChunkLen);return this};this.append=function(e){var r=0;var t=e.byteLength||e.length||e.size||0;var n=o.offset%o.maxChunkLen;var a;o.offset+=t;while(r<t){a=Math.min(t-r,o.maxChunkLen-n);b(e,r,a,n);n+=a;r+=a;if(n===o.maxChunkLen){o.core.hash(o.maxChunkLen,o.padMaxChunkLen);n=0}}return this};this.getState=function(){var e=o.offset%o.maxChunkLen;var r;if(!e){var t=new Int32Array(o.heap,o.padMaxChunkLen+320,5);r=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}else{r=o.heap.slice(0)}return{offset:o.offset,heap:r}};this.setState=function(e){o.offset=e.offset;if(e.heap.byteLength===20){var r=new Int32Array(o.heap,o.padMaxChunkLen+320,5);r.set(new Int32Array(e.heap))}else{o.h32.set(new Int32Array(e.heap))}return this};var k=this.rawEnd=function(){var e=o.offset;var r=e%o.maxChunkLen;var t=y(r,e);o.core.hash(t,o.padMaxChunkLen);var n=A(o.heap,o.padMaxChunkLen);w(o.heap,o.padMaxChunkLen);return n};this.end=function(){return a.toHex(k().buffer)}};r.exports._core=n;Iif(typeof self.FileReaderSync!=="undefined"){var f=new self.FileReaderSync}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./core.sjs":2,"./utils":6}],6:[function(e,r,t){"use strict";var n=new Array(256);for(var a=0;a<256;a++){n[a]=(a<16?"0":"")+a.toString(16)}r.exports.toHex=function(e){var r=new Uint8Array(e);var t=new Array(e.byteLength);for(var a=0;a<t.length;a++){t[a]=n[r[a]]}return t.join("")};r.exports.ceilHeapSize=function(e){var r;if(e<=65536)return 65536;if(e<16777216){for(r=1;r<e;r=r<<1);}else{for(r=16777216;r<e;r+=16777216);}return r}},{}],7:[function(e,r,t){"use strict";r.exports=function r(){var t=e("./rusha.js");var n=function e(r,t,n){try{return n(null,r.digest(t))}catch(e){return n(e)}};var a=function e(r,t,n,a,f){var i=new self.FileReader;i.onloadend=function o(){if(i.error){return f(i.error)}var s=i.result;t+=i.result.byteLength;try{r.append(s)}catch(e){f(e);return}if(t<a.size){e(r,t,n,a,f)}else{f(null,r.end())}};i.readAsArrayBuffer(a.slice(t,t+n))};var f=true;self.onmessage=function e(r){if(!f){return}var i=r.data.data,o=r.data.file,s=r.data.id;if(typeof s==="undefined")return;if(!o&&!i)return;var u=r.data.blockSize||4*1024*1024;var c=new t(u);c.resetState();var h=function e(r,t){if(!r){self.postMessage({id:s,hash:t})}else{self.postMessage({id:s,error:r.name})}};if(i)n(c,i,h);if(o)a(c,0,u,o,h)};return function e(){f=false}}},{"./rusha.js":5}]},{},[4])(4)}); |
| File | -- | Statements | -- | Branches | -- | Functions | -- | Lines | -- |
|---|---|---|---|---|---|---|---|---|---|
| dist/ | -12.47% | -108/866 | -11.11% | -36/324 | -21.05% | -24/114 | -8.91% | -35/393 | -