Thu Jan 4 23:33:16 CET 2018

This commit is contained in:
c9jenkinsv3 2018-01-04 23:33:16 +01:00
parent 3133235169
commit 486494cbf5
261 changed files with 3976 additions and 14032 deletions

View File

@ -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;
}

View File

@ -1,106 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for dist/</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">all files</a> dist/
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">12.47% </span>
<span class="quiet">Statements</span>
<span class='fraction'>108/866</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">11.11% </span>
<span class="quiet">Branches</span>
<span class='fraction'>36/324</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">21.05% </span>
<span class="quiet">Functions</span>
<span class='fraction'>24/114</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">8.91% </span>
<span class="quiet">Lines</span>
<span class='fraction'>35/393</span>
</div>
</div>
</div>
<div class='status-line low'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="rusha.js"><a href="rusha.js.html">rusha.js</a></td>
<td data-value="12.47" class="pic low"><div class="chart"><div class="cover-fill" style="width: 12%;"></div><div class="cover-empty" style="width:88%;"></div></div></td>
<td data-value="12.47" class="pct low">12.47%</td>
<td data-value="433" class="abs low">54/433</td>
<td data-value="11.11" class="pct low">11.11%</td>
<td data-value="162" class="abs low">18/162</td>
<td data-value="21.05" class="pct low">21.05%</td>
<td data-value="57" class="abs low">12/57</td>
<td data-value="8.67" class="pct low">8.67%</td>
<td data-value="392" class="abs low">34/392</td>
</tr>
<tr>
<td class="file low" data-value="rusha.min.js"><a href="rusha.min.js.html">rusha.min.js</a></td>
<td data-value="12.47" class="pic low"><div class="chart"><div class="cover-fill" style="width: 12%;"></div><div class="cover-empty" style="width:88%;"></div></div></td>
<td data-value="12.47" class="pct low">12.47%</td>
<td data-value="433" class="abs low">54/433</td>
<td data-value="11.11" class="pct low">11.11%</td>
<td data-value="162" class="abs low">18/162</td>
<td data-value="21.05" class="pct low">21.05%</td>
<td data-value="57" class="abs low">12/57</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Nov 26 2017 17:26:39 GMT+1100 (AEDT)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,93 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
/
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">12.47% </span>
<span class="quiet">Statements</span>
<span class='fraction'>108/866</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">11.11% </span>
<span class="quiet">Branches</span>
<span class='fraction'>36/324</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">21.05% </span>
<span class="quiet">Functions</span>
<span class='fraction'>24/114</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">8.91% </span>
<span class="quiet">Lines</span>
<span class='fraction'>35/393</span>
</div>
</div>
</div>
<div class='status-line low'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="dist/"><a href="dist/index.html">dist/</a></td>
<td data-value="12.47" class="pic low"><div class="chart"><div class="cover-fill" style="width: 12%;"></div><div class="cover-empty" style="width:88%;"></div></div></td>
<td data-value="12.47" class="pct low">12.47%</td>
<td data-value="866" class="abs low">108/866</td>
<td data-value="11.11" class="pct low">11.11%</td>
<td data-value="324" class="abs low">36/324</td>
<td data-value="21.05" class="pct low">21.05%</td>
<td data-value="114" class="abs low">24/114</td>
<td data-value="8.91" class="pct low">8.91%</td>
<td data-value="393" class="abs low">35/393</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Nov 26 2017 17:26:39 GMT+1100 (AEDT)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="sorter.js"></script>
</body>
</html>

View File

@ -1 +0,0 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

View File

@ -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;
}

View File

@ -1,106 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for dist/</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">all files</a> dist/
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">12.47% </span>
<span class="quiet">Statements</span>
<span class='fraction'>108/866</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">11.11% </span>
<span class="quiet">Branches</span>
<span class='fraction'>36/324</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">21.05% </span>
<span class="quiet">Functions</span>
<span class='fraction'>24/114</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">8.91% </span>
<span class="quiet">Lines</span>
<span class='fraction'>35/393</span>
</div>
</div>
</div>
<div class='status-line low'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="rusha.js"><a href="rusha.js.html">rusha.js</a></td>
<td data-value="12.47" class="pic low"><div class="chart"><div class="cover-fill" style="width: 12%;"></div><div class="cover-empty" style="width:88%;"></div></div></td>
<td data-value="12.47" class="pct low">12.47%</td>
<td data-value="433" class="abs low">54/433</td>
<td data-value="11.11" class="pct low">11.11%</td>
<td data-value="162" class="abs low">18/162</td>
<td data-value="21.05" class="pct low">21.05%</td>
<td data-value="57" class="abs low">12/57</td>
<td data-value="8.67" class="pct low">8.67%</td>
<td data-value="392" class="abs low">34/392</td>
</tr>
<tr>
<td class="file low" data-value="rusha.min.js"><a href="rusha.min.js.html">rusha.min.js</a></td>
<td data-value="12.47" class="pic low"><div class="chart"><div class="cover-fill" style="width: 12%;"></div><div class="cover-empty" style="width:88%;"></div></div></td>
<td data-value="12.47" class="pct low">12.47%</td>
<td data-value="433" class="abs low">54/433</td>
<td data-value="11.11" class="pct low">11.11%</td>
<td data-value="162" class="abs low">18/162</td>
<td data-value="21.05" class="pct low">21.05%</td>
<td data-value="57" class="abs low">12/57</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Nov 26 2017 17:26:39 GMT+1100 (AEDT)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>

View File

@ -1,93 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
/
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">12.47% </span>
<span class="quiet">Statements</span>
<span class='fraction'>108/866</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">11.11% </span>
<span class="quiet">Branches</span>
<span class='fraction'>36/324</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">21.05% </span>
<span class="quiet">Functions</span>
<span class='fraction'>24/114</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">8.91% </span>
<span class="quiet">Lines</span>
<span class='fraction'>35/393</span>
</div>
</div>
</div>
<div class='status-line low'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="dist/"><a href="dist/index.html">dist/</a></td>
<td data-value="12.47" class="pic low"><div class="chart"><div class="cover-fill" style="width: 12%;"></div><div class="cover-empty" style="width:88%;"></div></div></td>
<td data-value="12.47" class="pct low">12.47%</td>
<td data-value="866" class="abs low">108/866</td>
<td data-value="11.11" class="pct low">11.11%</td>
<td data-value="324" class="abs low">36/324</td>
<td data-value="21.05" class="pct low">21.05%</td>
<td data-value="114" class="abs low">24/114</td>
<td data-value="8.91" class="pct low">8.91%</td>
<td data-value="393" class="abs low">35/393</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Nov 26 2017 17:26:39 GMT+1100 (AEDT)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="sorter.js"></script>
</body>
</html>

View File

@ -1 +0,0 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,10 +0,0 @@
<html>
<head>
<script src="../dist/rusha.min.js"></script>
<script src="bench/johnston.js"></script>
<script src="bench/cifre/utils.js"></script>
<script src="bench/cifre/sha1.js"></script>
<script src="random.js"></script>
<script src="bench.js"></script>
</head>
</html>

View File

@ -1,17 +0,0 @@
<html>
<head>
<script type="text/javascript" src="../dist/rusha.min.js"></script>
<script type="text/javascript">
randomBytes = function (size) {
var bytes = new Uint8Array(size);
var r;
for (var i = 0, r; i < size; i++) {
if ((i & 0x03) == 0) r = Math.random() * 0x100000000;
bytes[i] = r >>> ((i & 0x03) << 3) & 0xff;
}
return bytes;
}
console.log(Rusha.createHash().update(randomBytes(8 * 1024 * 1024)).digest('hex'));
</script>
</head>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,114 +0,0 @@
macro rol1 { rule { ($v:expr) } => { ($v << 1 | $v >>> 31) } }
macro rol5 { rule { ($v:expr) } => { ($v << 5 | $v >>> 27) } }
macro rol30 { rule { ($v:expr) } => { ($v << 30 | $v >>> 2) } }
macro extended {
rule { ($H, $j:expr) } => {
rol1($H[$j-12>>2] ^ $H[$j-32>>2] ^ $H[$j-56>>2] ^ $H[$j-64>>2])
}
}
macro F0 { rule { ($b,$c,$d) } => { ($b & $c | ~$b & $d) } }
macro F1 { rule { ($b,$c,$d) } => { ($b ^ $c ^ $d) }}
macro F2 { rule { ($b,$c,$d) } => { ($b & $c | $b & $d | $c & $d) }}
macro swap {
rule { ($y0, $y1, $y2, $y3, $y4, $t0) } => {
$y4 = $y3;
$y3 = $y2;
$y2 = rol30($y1);
$y1 = $y0;
$y0 = $t0;
}
}
macro roundL { rule { ($y0, $f:expr) } => { (rol5($y0) + $f |0) } }
macro roundR { rule { ($y4, $t1) } => { ($t1 + $y4 |0) } }
// 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, foreign, heap) {
'use asm';
var H = new stdlib.Int32Array(heap);
function hash (k, x) { // k in bytes
k = k|0;
x = x|0;
var i = 0, j = 0,
y0 = 0, z0 = 0, y1 = 0, z1 = 0,
y2 = 0, z2 = 0, y3 = 0, z3 = 0,
y4 = 0, z4 = 0, t0 = 0, t1 = 0;
y0 = H[x+320>>2]|0;
y1 = H[x+324>>2]|0;
y2 = H[x+328>>2]|0;
y3 = H[x+332>>2]|0;
y4 = H[x+336>>2]|0;
for (i = 0; (i|0) < (k|0); i = i + 64 |0) {
z0 = y0;
z1 = y1;
z2 = y2;
z3 = y3;
z4 = y4;
for (j = 0; (j|0) < 64; j = j + 4 |0) {
t1 = H[i+j>>2]|0;
t0 = roundL(y0, F0(y1, y2, y3)) + (roundR(y4, t1) + 1518500249 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[k+j>>2] = t1;
}
for (j = k + 64 |0; (j|0) < (k + 80 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F0(y1, y2, y3)) + (roundR(y4, t1) + 1518500249 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
for (j = k + 80 |0; (j|0) < (k + 160 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F1(y1, y2, y3)) + (roundR(y4, t1) + 1859775393 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
for (j = k + 160 |0; (j|0) < (k + 240 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F2(y1, y2, y3)) + (roundR(y4, t1) - 1894007588 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
for (j = k + 240 |0; (j|0) < (k + 320 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F1(y1, y2, y3)) + (roundR(y4, t1) - 899497514 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
y0 = y0 + z0 |0;
y1 = y1 + z1 |0;
y2 = y2 + z2 |0;
y3 = y3 + z3 |0;
y4 = y4 + z4 |0;
}
H[x+320>>2] = y0;
H[x+324>>2] = y1;
H[x+328>>2] = y2;
H[x+332>>2] = y3;
H[x+336>>2] = y4;
}
return {hash: hash};
};

View File

@ -0,0 +1,11 @@
<html>
<head>
<script src="../rusha.js"></script>
<script src="../examples/bench/cifre/utils.js"></script>
<script type="text/javascript">
var arr = cifre_utils.fromhex("308203c6a00302010202020301300d06092a864886f70d01010505003063310b30090603550406130255533121301f060355040a131854686520476f2044616464792047726f75702c20496e632e3131302f060355040b1328476f20446164647920436c61737320322043657274696669636174696f6e20417574686f72697479301e170d3036313131363031353433375a170d3236313131363031353433375a3081ca310b30090603550406130255533110300e060355040813074172697a6f6e61311330110603550407130a53636f74747364616c65311a3018060355040a1311476f44616464792e636f6d2c20496e632e31333031060355040b132a687474703a2f2f6365727469666963617465732e676f64616464792e636f6d2f7265706f7369746f72793130302e06035504031327476f204461646479205365637572652043657274696669636174696f6e20417574686f726974793111300f06035504051308303739363932383730820122300d06092a864886f70d01010105000382010f003082010a0282010100c42dd5158c9c264cec3235eb5fb859015aa66181593b7063abe3dc3dc72ab8c933d379e43aed3c3023848eb33014b6b287c33d9554049edf99dd0b251e21de65297e35a8a954ebf6f73239d4265595adeffbfe5886d79ef4008d8c2a0cbd4204cea73f04f6ee80f2aaef52a16966dabe1aad5dda2c66ea1a6bbbe51a514a002f48c79875d8b929c8eef8666d0a9cb3f3fc787ca2f8a3f2b5c3f3b97a91c1a7e6252e9ca8ed12656e6af6124453703095c39c2b582b3d08744af2be51b0bf87d04c27586bb535c59daf1731f80b8feead813605890898cf3aaf2587c049eaa7fd67f7458e97cc1439e23685b57e1a37fd16f671119a743016fe1394a33f840d4f0203010001a38201323082012e301d0603551d0e04160414fdac6132936c45d6e2ee855f9abae7769968cce7301f0603551d23041830168014d2c4b0d291d44c1171b361cb3da1fedda86ad4e330120603551d130101ff040830060101ff020100303306082b0601050507010104273025302306082b060105050730018617687474703a2f2f6f6373702e676f64616464792e636f6d30460603551d1f043f303d303ba039a0378635687474703a2f2f6365727469666963617465732e676f64616464792e636f6d2f7265706f7369746f72792f6764726f6f742e63726c304b0603551d200444304230400604551d20003038303606082b06010505070201162a687474703a2f2f6365727469666963617465732e676f64616464792e636f6d2f7265706f7369746f7279300e0603551d0f0101ff040403020106");
var r = new Rusha();
console.log(r.digest(arr.buffer));
</script>
</head>
</html>

View File

@ -0,0 +1,40 @@
<html>
<head>
<meta charset="utf-8">
<title>Mocha Tests</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<script src="../node_modules/mocha/mocha.js"></script>
<script>mocha.setup('bdd')</script>
<script src="bundle.js"></script>
<script>
onload = function (){
var runner = mocha.run();
var failedTests = [];
runner.on('end', function(){
window.mochaResults = runner.stats;
window.mochaResults.reports = failedTests;
});
runner.on('fail', function (test, err) {
var flattenTitles = function(test){
var titles = [];
while (test.parent.title){
titles.push(test.parent.title);
test = test.parent;
}
return titles.reverse();
};
failedTests.push({name: test.title, result: false, message: err.message, stack: err.stack, titles: flattenTitles(test) });
});
};
</script>
</body>
</html>

View File

@ -1,13 +0,0 @@
{
"plugins": [
"transform-es2015-arrow-functions",
["transform-es2015-block-scoping", {
"throwIfClosureRequired": true
}],
"transform-es2015-block-scoped-functions",
["transform-es2015-classes", {
"loose": true
}],
"transform-es2015-destructuring"
]
}

View File

@ -1,25 +0,0 @@
module.exports = {
"parser": "babel-eslint",
"extends": "eslint:recommended",
"rules": {
// enable additional rules
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"no-var": "error",
"no-cond-assign": ["error", "always"],
"strict": ["error", "global"],
// disable rules from base configurations
"no-console": "off",
"no-fallthrough": "off"
},
"globals": {
"ArrayBuffer": true,
"DataView": true,
"Int8Array": true,
"Int32Array": true,
"Uint8Array": true
}
};

View File

@ -1,173 +1,85 @@
module.exports = function (grunt) {
const browsers = ['ChromeHeadless', 'FirefoxHeadless'];
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sweetjs: {
options: {
readableNames: true
},
build: {
src: '<%= pkg.name %>.sweet.js',
dest: '<%= pkg.name %>.js'
},
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
compress: false
},
build: {
src: 'dist/<%= pkg.name %>.js',
dest: 'dist/<%= pkg.name %>.min.js'
src: '<%= pkg.name %>.js',
dest: '<%= pkg.name %>.min.js'
}
},
browserify: {
options: {
transform: ['strictify', 'sweetify', 'babelify'],
plugin: ['browserify-derequire'],
browserifyOptions: {
standalone: 'Rusha'
}
},
build: {
files: {
'dist/rusha.js': ['src/index.js']
}
test: {
src: ['<%= pkg.name %>.min.js', 'test/test.js'],
dest: 'test/bundle.js'
}
},
karma: {
options: {
basePath: '',
singleRun: true,
logLevel: 'WARN',
files: [],
reporters: ['mocha'],
mochaReporter: {
showDiff: true
mochaTest: {
test: {
options: {
reporter: 'spec',
require: 'coverage/blanket'
},
customLaunchers: {
FirefoxHeadless: {
base: 'Firefox',
flags: ['-headless'],
},
src: ['test/test.js'],
},
coverage: {
options: {
reporter: 'html-cov',
quiet: true,
captureFile: 'coverage/report.html'
},
browserNoActivityTimeout: 60000
},
unit: {
options: {
frameworks: ['browserify', 'mocha', 'chai'],
files: ['test/unit/*.js'],
preprocessors: {
'test/unit/*.js': ['browserify']
},
browsers
}
},
fuzz: {
options: {
frameworks: ['browserify', 'mocha', 'chai'],
files: ['test/fuzz.js'],
preprocessors: {
'test/fuzz.js': ['browserify']
},
browsers
}
},
functional: {
options: {
frameworks: ['browserify', 'mocha', 'chai-as-promised', 'chai'],
files: ['test/functional/*.js'],
preprocessors: {
'test/functional/*.js': ['browserify']
},
browserify: {
transform: ['brfs']
},
browsers
}
},
compatibilityWithVanillaScript: {
options: {
frameworks: ['mocha', 'chai-as-promised', 'chai'],
files: [
'test/compat/vanilla_script.js',
'dist/rusha.min.js'
],
browsers
}
},
compatibilityWithVanillaWorker: {
options: {
frameworks: ['mocha', 'chai-as-promised', 'chai'],
files: [
'test/compat/vanilla_worker.js',
{pattern: 'dist/rusha.min.js', included: false, served: true}
],
browsers
}
},
compatibilityWithBrowserify: {
options: {
frameworks: ['mocha', 'chai-as-promised', 'chai', 'browserify'],
files: [
'test/compat/require.js',
],
preprocessors: {
'test/compat/require.js': ['browserify']
},
browsers
}
},
compatibilityWithWebpack: {
options: {
frameworks: ['mocha', 'chai-as-promised', 'chai'],
files: [
'test/compat/require.js',
],
preprocessors: {
'test/compat/require.js': ['webpack']
},
browsers
}
},
benchmark: {
options: {
frameworks: ['browserify', 'benchmark'],
reporters: ['benchmark'],
files: ['perf/benchmark.js'],
preprocessors: {
'perf/benchmark.js': ['browserify']
},
browsers
}
src: ['test/test.js']
}
},
eslint: {
target: [
'src/*.js'
]
connect: { server: { options: { base: "", port: 9999 } } },
'saucelabs-mocha': {
all: {
options: {
username: 'rusha',
urls: ['http://127.0.0.1:9999/test/test.html'],
build: process.env.CI_BUILD_NUMBER,
testname: 'Sauce Unit Test for Rusha',
browsers: [
["Windows 8", "firefox", 32],
["Windows 8", "chrome", 37]
]
}
}
}
});
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-sweet.js');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.registerTask('test', [
'eslint',
'sweetjs', 'uglify',
'browserify',
'uglify',
'karma:unit',
'karma:fuzz',
'karma:functional',
'karma:compatibilityWithVanillaScript',
'karma:compatibilityWithVanillaWorker',
'karma:compatibilityWithBrowserify',
'karma:compatibilityWithWebpack'
'mochaTest'
]);
grunt.registerTask('test:unit', [
'eslint',
grunt.registerTask('test-saucelabs', [
'sweetjs', 'uglify',
'browserify',
'uglify',
'karma:unit'
'connect', 'saucelabs-mocha'
]);
grunt.registerTask('benchmark', ['browserify', 'uglify', 'karma:benchmark']);
grunt.registerTask('build', ['eslint', 'browserify', 'uglify']);
grunt.registerTask('build', ['sweetjs', 'uglify']);
};

View File

@ -0,0 +1,36 @@
if (typeof require === 'function') {
var crypto = require('crypto');
var johnston = require('../examples/bench/johnston');
var Rusha = require('../rusha');
var cifre_utils = require('../examples/bench/cifre/utils.js');
var cifre_sha1 = require('../examples/bench/cifre/sha1.js');
var random = require('../examples/random');
var fnNative = random.fnNative,
randomBytes = random.randomBytes;
var Benchmark = require('benchmark');
}
var _rush = new Rusha(1 * 1024 * 1024);
var bytes = randomBytes(1 * 1024 * 1024);
(new Benchmark.Suite)
.add('Rusha', function() {
_rush.digest(bytes);
})
.add('Johnston', function() {
johnston(bytes);
})
.add('Cifre', function () {
cifre_utils.tohex(cifre_sha1(bytes));
})
.on('cycle', function(event) {
console.log(String(event.target));
})
.on('complete', function() {
console.log('Fastest is ' + this.filter('fastest').pluck('name'));
})
.run();

View File

@ -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;
}

View File

@ -1,93 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
/
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">12.47% </span>
<span class="quiet">Statements</span>
<span class='fraction'>108/866</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">11.11% </span>
<span class="quiet">Branches</span>
<span class='fraction'>36/324</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">21.05% </span>
<span class="quiet">Functions</span>
<span class='fraction'>24/114</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">8.91% </span>
<span class="quiet">Lines</span>
<span class='fraction'>35/393</span>
</div>
</div>
</div>
<div class='status-line low'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="dist/"><a href="dist/index.html">dist/</a></td>
<td data-value="12.47" class="pic low"><div class="chart"><div class="cover-fill" style="width: 12%;"></div><div class="cover-empty" style="width:88%;"></div></div></td>
<td data-value="12.47" class="pct low">12.47%</td>
<td data-value="866" class="abs low">108/866</td>
<td data-value="11.11" class="pct low">11.11%</td>
<td data-value="324" class="abs low">36/324</td>
<td data-value="21.05" class="pct low">21.05%</td>
<td data-value="114" class="abs low">24/114</td>
<td data-value="8.91" class="pct low">8.91%</td>
<td data-value="393" class="abs low">35/393</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Nov 26 2017 17:26:39 GMT+1100 (AEDT)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="sorter.js"></script>
</body>
</html>

View File

@ -1 +0,0 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

View File

@ -1,158 +0,0 @@
var addSorting = (function () {
"use strict";
var cols,
currentSort = {
index: 0,
desc: false
};
// returns the summary table element
function getTable() { return document.querySelector('.coverage-summary'); }
// returns the thead element of the summary table
function getTableHeader() { return getTable().querySelector('thead tr'); }
// returns the tbody element of the summary table
function getTableBody() { return getTable().querySelector('tbody'); }
// returns the th element for nth column
function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
colNode,
cols = [],
col,
i;
for (i = 0; i < colNodes.length; i += 1) {
colNode = colNodes[i];
col = {
key: colNode.getAttribute('data-col'),
sortable: !colNode.getAttribute('data-nosort'),
type: colNode.getAttribute('data-type') || 'string'
};
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
}
// attaches a data attribute to every tr element with an object
// of data values keyed by column name
function loadRowData(tableRow) {
var tableCols = tableRow.querySelectorAll('td'),
colNode,
col,
data = {},
i,
val;
for (i = 0; i < tableCols.length; i += 1) {
colNode = tableCols[i];
col = cols[i];
val = colNode.getAttribute('data-value');
if (col.type === 'number') {
val = Number(val);
}
data[col.key] = val;
}
return data;
}
// loads all row data
function loadData() {
var rows = getTableBody().querySelectorAll('tr'),
i;
for (i = 0; i < rows.length; i += 1) {
rows[i].data = loadRowData(rows[i]);
}
}
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function (a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
},
finalSorter = sorter,
tableBody = document.querySelector('.coverage-summary tbody'),
rowNodes = tableBody.querySelectorAll('tr'),
rows = [],
i;
if (desc) {
finalSorter = function (a, b) {
return -1 * sorter(a, b);
};
}
for (i = 0; i < rowNodes.length; i += 1) {
rows.push(rowNodes[i]);
tableBody.removeChild(rowNodes[i]);
}
rows.sort(finalSorter);
for (i = 0; i < rows.length; i += 1) {
tableBody.appendChild(rows[i]);
}
}
// removes sort indicators for current column being sorted
function removeSortIndicators() {
var col = getNthColumn(currentSort.index),
cls = col.className;
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
col.className = cls;
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
return function () {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
desc = !currentSort.desc;
}
sortByIndex(i, desc);
removeSortIndicators();
currentSort.index = i;
currentSort.desc = desc;
addSortIndicators();
};
};
for (i =0 ; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
el = getNthColumn(i).querySelector('.sorter').parentElement;
if (el.addEventListener) {
el.addEventListener('click', ithSorter(i));
} else {
el.attachEvent('onclick', ithSorter(i));
}
}
}
}
// adds sorting functionality to the UI
return function () {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData(cols);
addSortIndicators();
enableUI();
};
})();
window.addEventListener('load', addSorting);

View File

@ -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;
}

View File

@ -1,93 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
/
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">12.47% </span>
<span class="quiet">Statements</span>
<span class='fraction'>108/866</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">11.11% </span>
<span class="quiet">Branches</span>
<span class='fraction'>36/324</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">21.05% </span>
<span class="quiet">Functions</span>
<span class='fraction'>24/114</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">8.91% </span>
<span class="quiet">Lines</span>
<span class='fraction'>35/393</span>
</div>
</div>
</div>
<div class='status-line low'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="dist/"><a href="dist/index.html">dist/</a></td>
<td data-value="12.47" class="pic low"><div class="chart"><div class="cover-fill" style="width: 12%;"></div><div class="cover-empty" style="width:88%;"></div></div></td>
<td data-value="12.47" class="pct low">12.47%</td>
<td data-value="866" class="abs low">108/866</td>
<td data-value="11.11" class="pct low">11.11%</td>
<td data-value="324" class="abs low">36/324</td>
<td data-value="21.05" class="pct low">21.05%</td>
<td data-value="114" class="abs low">24/114</td>
<td data-value="8.91" class="pct low">8.91%</td>
<td data-value="393" class="abs low">35/393</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Nov 26 2017 17:26:39 GMT+1100 (AEDT)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="sorter.js"></script>
</body>
</html>

View File

@ -1 +0,0 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

View File

@ -1,158 +0,0 @@
var addSorting = (function () {
"use strict";
var cols,
currentSort = {
index: 0,
desc: false
};
// returns the summary table element
function getTable() { return document.querySelector('.coverage-summary'); }
// returns the thead element of the summary table
function getTableHeader() { return getTable().querySelector('thead tr'); }
// returns the tbody element of the summary table
function getTableBody() { return getTable().querySelector('tbody'); }
// returns the th element for nth column
function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
colNode,
cols = [],
col,
i;
for (i = 0; i < colNodes.length; i += 1) {
colNode = colNodes[i];
col = {
key: colNode.getAttribute('data-col'),
sortable: !colNode.getAttribute('data-nosort'),
type: colNode.getAttribute('data-type') || 'string'
};
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
}
// attaches a data attribute to every tr element with an object
// of data values keyed by column name
function loadRowData(tableRow) {
var tableCols = tableRow.querySelectorAll('td'),
colNode,
col,
data = {},
i,
val;
for (i = 0; i < tableCols.length; i += 1) {
colNode = tableCols[i];
col = cols[i];
val = colNode.getAttribute('data-value');
if (col.type === 'number') {
val = Number(val);
}
data[col.key] = val;
}
return data;
}
// loads all row data
function loadData() {
var rows = getTableBody().querySelectorAll('tr'),
i;
for (i = 0; i < rows.length; i += 1) {
rows[i].data = loadRowData(rows[i]);
}
}
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function (a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
},
finalSorter = sorter,
tableBody = document.querySelector('.coverage-summary tbody'),
rowNodes = tableBody.querySelectorAll('tr'),
rows = [],
i;
if (desc) {
finalSorter = function (a, b) {
return -1 * sorter(a, b);
};
}
for (i = 0; i < rowNodes.length; i += 1) {
rows.push(rowNodes[i]);
tableBody.removeChild(rowNodes[i]);
}
rows.sort(finalSorter);
for (i = 0; i < rows.length; i += 1) {
tableBody.appendChild(rows[i]);
}
}
// removes sort indicators for current column being sorted
function removeSortIndicators() {
var col = getNthColumn(currentSort.index),
cls = col.className;
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
col.className = cls;
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
return function () {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
desc = !currentSort.desc;
}
sortByIndex(i, desc);
removeSortIndicators();
currentSort.index = i;
currentSort.desc = desc;
addSortIndicators();
};
};
for (i =0 ; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
el = getNthColumn(i).querySelector('.sorter').parentElement;
if (el.addEventListener) {
el.addEventListener('click', ithSorter(i));
} else {
el.attachEvent('onclick', ithSorter(i));
}
}
}
}
// adds sorting functionality to the UI
return function () {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData(cols);
addSortIndicators();
enableUI();
};
})();
window.addEventListener('load', addSorting);

View File

@ -0,0 +1,6 @@
var path = require('path');
var srcDir = path.join(__dirname, '..', 'rusha.js');
require('blanket')({
pattern: srcDir
});

File diff suppressed because one or more lines are too long

View File

@ -1,10 +0,0 @@
<html>
<head>
<script src="../dist/rusha.min.js"></script>
<script src="bench/johnston.js"></script>
<script src="bench/cifre/utils.js"></script>
<script src="bench/cifre/sha1.js"></script>
<script src="random.js"></script>
<script src="bench.js"></script>
</head>
</html>

View File

@ -1,47 +0,0 @@
if (typeof require === 'function') {
var crypto = require('crypto');
var johnston = require('./bench/johnston');
var Rusha = require('../dist/rusha.min.js');
var cifre_utils = require('./bench/cifre/utils.js');
var cifre_sha1 = require('./bench/cifre/sha1.js');
var random = require('./random');
var fnNative = random.fnNative,
randomBytes = random.randomBytes;
}
var sizes = [4*1024, 65535, 1024*1024, 4*1024*1024, 8*1024*1024];
var repeats = [ 100, 30, 3, 1, 1];
var _rush = new Rusha(Math.max.apply(Math, sizes)),
fnRusha = function (bytes) {
return _rush.digestFromBuffer(bytes);
};
var fnJohnston = function (bytes) {
return johnston(bytes);
};
var fnCifre = function (bytes) {
return cifre_utils.tohex(cifre_sha1(bytes));
};
var ids = ['Native ', 'Rusha ', 'Johnst. ', 'Cifre '];
var fns = [fnNative, fnRusha, fnJohnston, fnCifre];
var bench = function () {
sizes.forEach(function (size, k) {
console.log('Benchmarking ' + size + ' bytes ...');
var bytes = randomBytes(size);
fns.forEach(function (fn, i) {
var t0 = (new Date()).getTime();
var res = "";
for (j=0;j<repeats[k];j++)
res += fn(bytes);
var t1 = (new Date()).getTime();
console.log(ids[i] + ' emitted ' + res.substring(0,40) + ' in ' + ((t1-t0)/repeats[k]) + ' milliseconds');
});
});
}
bench();

View File

@ -1,195 +0,0 @@
/*
Copyright (c) 2013 SMB Phone Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
( // Module boilerplate to support browser globals, node.js and AMD.
(typeof module !== "undefined" && function (m) { module.exports = m(); }) ||
(typeof define === "function" && function (m) { define(m); }) ||
(function (m) { window.cifre_sha1 = m(); })
)(function(){
"use strict";
var state = new Uint32Array(5);
var bstate = new Uint8Array(state.buffer);
// Create a buffer for each 80 word block.
var block = new Uint32Array(80);
function common(a, e, w, k, f) {
return (f + e + w + k + ((a << 5) | (a >>> 27))) >>> 0;
}
function f1(a, b, c, d, e, w) {
return common(a, e, w, 0x5A827999, d ^ (b & (c ^ d)));
}
function f2(a, b, c, d, e, w) {
return common(a, e, w, 0x6ED9EBA1, b ^ c ^ d);
}
function f3(a, b, c, d, e, w) {
return common(a, e, w, 0x8F1BBCDC, (b & c) | (d & (b | c)));
}
function f4(a, b, c, d, e, w) {
return common(a, e, w, 0xCA62C1D6, b ^ c ^ d);
}
// function hex8(num) {
// var hex = num.toString(16).toUpperCase();
// return "00000000".substr(hex.length) + hex;
// }
function cycle(state, block) {
var a = state[0],
b = state[1],
c = state[2],
d = state[3],
e = state[4];
// console.log("\nInitial hash value:");
// for (var i = 0; i < 5; i++) {
// console.log(" H[" + i + "] = " + hex8(state[i]));
// }
// console.log("\nBlock Contents:");
// for (var i = 0; i < 16; i++) {
// console.log(" W[" + i + "] = " + hex8(block[i]));
// }
// console.log("\n A B C D E");
// Partially unroll loops so we don't have to shift variables.
var fn = f1;;
for (var i = 0; i < 80; i += 5) {
if (i === 20) { fn = f2; }
else if (i === 40) { fn = f3; }
else if (i === 60) { fn = f4; }
e = fn(a, b, c, d, e, block[i]); b = ((b << 30) | (b >>> 2)) >>> 0;
// console.log("t=%s: %s %s %s %s %s", i,
// hex8(e), hex8(a), hex8(b), hex8(c), hex8(d));
d = fn(e, a, b, c, d, block[i + 1]); a = ((a << 30) | (a >>> 2)) >>> 0;
// console.log("t=%s: %s %s %s %s %s", i + 1,
// hex8(d), hex8(e), hex8(a), hex8(b), hex8(c));
c = fn(d, e, a, b, c, block[i + 2]); e = ((e << 30) | (e >>> 2)) >>> 0;
// console.log("t=%s: %s %s %s %s %s", i + 2,
// hex8(c), hex8(d), hex8(e), hex8(a), hex8(b));
b = fn(c, d, e, a, b, block[i + 3]); d = ((d << 30) | (d >>> 2)) >>> 0;
// console.log("t=%s: %s %s %s %s %s", i + 3,
// hex8(b), hex8(c), hex8(d), hex8(e), hex8(a));
a = fn(b, c, d, e, a, block[i + 4]); c = ((c << 30) | (c >>> 2)) >>> 0;
// console.log("t=%s: %s %s %s %s %s", i + 4,
// hex8(a), hex8(b), hex8(c), hex8(d), hex8(e));
}
// console.log();
// process.stdout.write("H[0] = " + hex8(state[0]) + " + " + hex8(a));
state[0] += a;
// console.log(" = " + hex8(state[0]));
// process.stdout.write("H[1] = " + hex8(state[1]) + " + " + hex8(b));
state[1] += b;
// console.log(" = " + hex8(state[1]));
// process.stdout.write("H[2] = " + hex8(state[2]) + " + " + hex8(c));
state[2] += c;
// console.log(" = " + hex8(state[2]));
// process.stdout.write("H[3] = " + hex8(state[3]) + " + " + hex8(d));
state[3] += d;
// console.log(" = " + hex8(state[3]));
// process.stdout.write("H[4] = " + hex8(state[4]) + " + " + hex8(e));
state[4] += e;
// console.log(" = " + hex8(state[4]));
}
// input is a Uint8Array bitstream of the data
function sha1(input) {
var inputLength = input.length;
// Pad the input string length.
var length = inputLength + 9;
length += 64 - (length % 64);
state[0] = 0x67452301;
state[1] = 0xefcdab89;
state[2] = 0x98badcfe;
state[3] = 0x10325476;
state[4] = 0xc3d2e1f0;
for (var offset = 0; offset < length; offset += 64) {
// Copy input to block and write padding as needed
for (var i = 0; i < 64; i++) {
var b = 0,
o = offset + i;
if (o < inputLength) {
b = input[o];
}
else if (o === inputLength) {
b = 0x80;
}
else {
// Write original bit length as a 64bit big-endian integer to the end.
var x = length - o - 1;
if (x >= 0 && x < 4) {
b = (inputLength << 3 >>> (x * 8)) & 0xff;
}
}
// Interpret the input bytes as big-endian per the spec
if (i % 4 === 0) {
block[i >> 2] = b << 24;
}
else {
block[i >> 2] |= b << ((3 - (i % 4)) * 8);
}
}
// Extend the block
for (var i = 16; i < 80; i++) {
var w = block[i - 3] ^ block[i - 8] ^ block[i - 14] ^ block[i - 16];
block[i] = (w << 1) | (w >>> 31);
}
cycle(state, block);
}
// Swap the bytes around since they are big endian internally
return [
bstate[3], bstate[2], bstate[1], bstate[0],
bstate[7], bstate[6], bstate[5], bstate[4],
bstate[11], bstate[10], bstate[9], bstate[8],
bstate[15], bstate[14], bstate[13], bstate[12],
bstate[19], bstate[18], bstate[17], bstate[16],
]
}
return sha1;
});

View File

@ -1,123 +0,0 @@
/*
Copyright (c) 2013 SMB Phone Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
( // Module boilerplate to support browser globals, node.js and AMD.
(typeof module !== "undefined" && function (m) { module.exports = m(); }) ||
(typeof define === "function" && function (m) { define(m); }) ||
(function (m) { window.cifre_utils = m(); })
)(function () {
"use strict";
function hex(val) {
if (val >>> 0 !== val) { return " "; }
if (val < 0x10) { return "0" + val.toString(16); }
return val.toString(16);
}
function ensureArray(buffer) {
if (buffer instanceof Uint8Array) {
return buffer;
}
if (buffer instanceof ArrayBuffer || Array.isArray(buffer)) {
return new Uint8Array(buffer);
}
if (buffer.buffer instanceof ArrayBuffer) {
return new Uint8Array(buffer.buffer);
}
throw new TypeError("Invalid buffer type " + buffer);
}
// Dump a Uint8Array as a 4-row hex stream
function dump(block) {
block = ensureArray(block);
var rows = new Array(4);
var width = Math.ceil(block.length / 4);
for (var i = 0; i < 4; i++) {
rows[i] = new Array(width);
for (var j = 0; j < width; j++) {
rows[i][j] = block[i + j * 4];
}
}
console.log(rows.map(function (row) {
return row.map(function (val, i) {
if (val === undefined) return "";
return hex(val) + ((i % 4 === 3) ? " " : ","); }).join("");
}).join("\n"));
}
function fromhex(string) {
var length = string.length;
var array = new Uint8Array(length / 2);
for (var i = 0; i < length; i += 2) {
array[i / 2] = parseInt(string.substr(i, 2), 16);
}
return array;
}
function tohex(array) {
var string = "";
array = ensureArray(array);
for (var i = 0, l = array.length; i < l; i++) {
string += hex(array[i]);
}
return string;
}
function stringToArray(string) {
// UTF-8 encode the string using one character per byte
string = unescape(encodeURIComponent(string));
var length = string.length;
var arr = new Array(length);
for (var i = 0; i < length; i++) {
arr[i] = string.charCodeAt(i);
}
return arr;
}
function stringToBuffer(string) {
// UTF-8 encode the string using one character per byte
string = unescape(encodeURIComponent(string));
var length = string.length;
var arr = new Uint8Array(length);
for (var i = 0; i < length; i++) {
arr[i] = string.charCodeAt(i);
}
return arr;
}
return {
dump: dump,
tohex: tohex,
fromhex: fromhex,
stringToArray: stringToArray,
stringToBuffer: stringToBuffer
};
});

View File

@ -1,354 +0,0 @@
/*
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
* in FIPS 180-1
* Version 2.2 Copyright Paul Johnston 2000 - 2009.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for details.
*/
/*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
if (typeof module !== 'undefined') {
module.exports = function (s) { return rstr2hex(binb2rstr(binb_sha1(buf2binb(s), s.length * 8))); }
} else {
function johnston (s) { return rstr2hex(binb2rstr(binb_sha1(tarr2binb(s), s.byteLength * 8))); }
}
function hex_sha1(s) { return rstr2hex(rstr_sha1(str2rstr_utf8(s))); }
function b64_sha1(s) { return rstr2b64(rstr_sha1(str2rstr_utf8(s))); }
function any_sha1(s, e) { return rstr2any(rstr_sha1(str2rstr_utf8(s)), e); }
function hex_hmac_sha1(k, d)
{ return rstr2hex(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d))); }
function b64_hmac_sha1(k, d)
{ return rstr2b64(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d))); }
function any_hmac_sha1(k, d, e)
{ return rstr2any(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d)), e); }
/*
* Perform a simple self-test to see if the VM is working
*/
function sha1_vm_test()
{
return hex_sha1("abc").toLowerCase() == "a9993e364706816aba3e25717850c26c9cd0d89d";
}
/*
* Calculate the SHA1 of a raw string
*/
function rstr_sha1(s)
{
return binb2rstr(binb_sha1(rstr2binb(s), s.length * 8));
}
/*
* Calculate the HMAC-SHA1 of a key and some data (raw strings)
*/
function rstr_hmac_sha1(key, data)
{
var bkey = rstr2binb(key);
if(bkey.length > 16) bkey = binb_sha1(bkey, key.length * 8);
var ipad = Array(16), opad = Array(16);
for(var i = 0; i < 16; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = binb_sha1(ipad.concat(rstr2binb(data)), 512 + data.length * 8);
return binb2rstr(binb_sha1(opad.concat(hash), 512 + 160));
}
/*
* Convert a raw string to a hex string
*/
function rstr2hex(input)
{
try { hexcase } catch(e) { hexcase=0; }
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var output = "";
var x;
for(var i = 0; i < input.length; i++)
{
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4) & 0x0F)
+ hex_tab.charAt( x & 0x0F);
}
return output;
}
/*
* Convert a raw string to a base-64 string
*/
function rstr2b64(input)
{
try { b64pad } catch(e) { b64pad=''; }
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var output = "";
var len = input.length;
for(var i = 0; i < len; i += 3)
{
var triplet = (input.charCodeAt(i) << 16)
| (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
| (i + 2 < len ? input.charCodeAt(i+2) : 0);
for(var j = 0; j < 4; j++)
{
if(i * 8 + j * 6 > input.length * 8) output += b64pad;
else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
}
}
return output;
}
/*
* Convert a raw string to an arbitrary string encoding
*/
function rstr2any(input, encoding)
{
var divisor = encoding.length;
var remainders = Array();
var i, q, x, quotient;
/* Convert to an array of 16-bit big-endian values, forming the dividend */
var dividend = Array(Math.ceil(input.length / 2));
for(i = 0; i < dividend.length; i++)
{
dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
}
/*
* Repeatedly perform a long division. The binary array forms the dividend,
* the length of the encoding is the divisor. Once computed, the quotient
* forms the dividend for the next step. We stop when the dividend is zero.
* All remainders are stored for later use.
*/
while(dividend.length > 0)
{
quotient = Array();
x = 0;
for(i = 0; i < dividend.length; i++)
{
x = (x << 16) + dividend[i];
q = Math.floor(x / divisor);
x -= q * divisor;
if(quotient.length > 0 || q > 0)
quotient[quotient.length] = q;
}
remainders[remainders.length] = x;
dividend = quotient;
}
/* Convert the remainders to the output string */
var output = "";
for(i = remainders.length - 1; i >= 0; i--)
output += encoding.charAt(remainders[i]);
/* Append leading zero equivalents */
var full_length = Math.ceil(input.length * 8 /
(Math.log(encoding.length) / Math.log(2)))
for(i = output.length; i < full_length; i++)
output = encoding[0] + output;
return output;
}
/*
* Encode a string as utf-8.
* For efficiency, this assumes the input is valid utf-16.
*/
function str2rstr_utf8(input)
{
var output = "";
var i = -1;
var x, y;
while(++i < input.length)
{
/* Decode utf-16 surrogate pairs */
x = input.charCodeAt(i);
y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)
{
x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
i++;
}
/* Encode output as utf-8 */
if(x <= 0x7F)
output += String.fromCharCode(x);
else if(x <= 0x7FF)
output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),
0x80 | ( x & 0x3F));
else if(x <= 0xFFFF)
output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
0x80 | ((x >>> 6 ) & 0x3F),
0x80 | ( x & 0x3F));
else if(x <= 0x1FFFFF)
output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
0x80 | ((x >>> 12) & 0x3F),
0x80 | ((x >>> 6 ) & 0x3F),
0x80 | ( x & 0x3F));
}
return output;
}
/*
* Encode a string as utf-16
*/
function str2rstr_utf16le(input)
{
var output = "";
for(var i = 0; i < input.length; i++)
output += String.fromCharCode( input.charCodeAt(i) & 0xFF,
(input.charCodeAt(i) >>> 8) & 0xFF);
return output;
}
function str2rstr_utf16be(input)
{
var output = "";
for(var i = 0; i < input.length; i++)
output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
input.charCodeAt(i) & 0xFF);
return output;
}
/*
* Convert a raw string to an array of big-endian words
* Characters >255 have their high-byte silently ignored.
*/
function rstr2binb(input)
{
var output = Array(input.length >> 2);
for(var i = 0; i < output.length; i++)
output[i] = 0;
for(var i = 0; i < input.length * 8; i += 8)
output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32);
return output;
}
function buf2binb(input)
{
var output = Array(input.length >> 2);
for(var i = 0; i < output.length; i++)
output[i] = 0;
for(var i = 0; i < input.length * 8; i += 8)
output[i>>5] |= (input[i / 8] & 0xFF) << (24 - i % 32);
return output;
}
function tarr2binb(input)
{
var output = Array(input.byteLength >> 2);
for(var i = 0; i < output.length; i++)
output[i] = 0;
for(var i = 0; i < input.byteLength * 8; i += 8)
output[i>>5] |= (input[i / 8] & 0xFF) << (24 - i % 32);
return output;
}
/*
* Convert an array of big-endian words to a string
*/
function binb2rstr(input)
{
var output = "";
for(var i = 0; i < input.length * 32; i += 8)
output += String.fromCharCode((input[i>>5] >>> (24 - i % 32)) & 0xFF);
return output;
}
/*
* Calculate the SHA-1 of an array of big-endian words, and a bit length
*/
function binb_sha1(x, len)
{
/* append padding */
x[len >> 5] |= 0x80 << (24 - len % 32);
x[((len + 64 >> 9) << 4) + 15] = len;
var w = Array(80);
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
var e = -1009589776;
for(var i = 0; i < x.length; i += 16)
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
var olde = e;
for(var j = 0; j < 80; j++)
{
if(j < 16) w[j] = x[i + j];
else w[j] = bit_rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
var t = safe_add(safe_add(bit_rol(a, 5), sha1_ft(j, b, c, d)),
safe_add(safe_add(e, w[j]), sha1_kt(j)));
e = d;
d = c;
c = bit_rol(b, 30);
b = a;
a = t;
}
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
e = safe_add(e, olde);
}
return Array(a, b, c, d, e);
}
/*
* Perform the appropriate triplet combination function for the current
* iteration
*/
function sha1_ft(t, b, c, d)
{
if(t < 20) return (b & c) | ((~b) & d);
if(t < 40) return b ^ c ^ d;
if(t < 60) return (b & c) | (b & d) | (c & d);
return b ^ c ^ d;
}
/*
* Determine the appropriate additive constant for the current iteration
*/
function sha1_kt(t)
{
return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
(t < 60) ? -1894007588 : -899497514;
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}

View File

@ -1,39 +0,0 @@
if (typeof require === 'function') {
var crypto = require('crypto');
var johnston = require('./bench/johnston');
var Rusha = require('../dist/rusha.js');
var cifre_utils = require('./bench/cifre/utils.js');
var cifre_sha1 = require('./bench/cifre/sha1.js');
}
if (typeof module !== 'undefined') {
module.exports = {
fnNative: function (bytes) {
var shasum = crypto.createHash('sha1');
shasum.update(bytes);
return shasum.digest('hex');
},
randomBytes: function (size) {
return crypto.pseudoRandomBytes(size);
},
};
} else {
function fnNative () { return 'unavailable'; }
function randomBytes (size) {
var bytes = new Uint8Array(size);
var r;
for (var i = 0, r; i < size; i++) {
if ((i & 0x03) == 0) r = Math.random() * 0x100000000;
bytes[i] = r >>> ((i & 0x03) << 3) & 0xff;
}
return bytes;
}
}

View File

@ -1,17 +0,0 @@
<html>
<head>
<script type="text/javascript" src="../dist/rusha.min.js"></script>
<script type="text/javascript">
randomBytes = function (size) {
var bytes = new Uint8Array(size);
var r;
for (var i = 0, r; i < size; i++) {
if ((i & 0x03) == 0) r = Math.random() * 0x100000000;
bytes[i] = r >>> ((i & 0x03) << 3) & 0xff;
}
return bytes;
}
console.log(Rusha.createHash().update(randomBytes(8 * 1024 * 1024)).digest('hex'));
</script>
</head>
</html>

View File

@ -1,18 +0,0 @@
if (typeof require === 'function') {
var Rusha = require('../dist/rusha.js');
var randomBytes = require('crypto').pseudoRandomBytes;
}
var sizes = [4*1024, 65535, 1024*1024, 4*1024*1024, 8*1024*1024];
var _rush = new Rusha(Math.max.apply(Math, sizes));
var i, j, bytes, t0, t1;
for (i = 0; i < sizes.length; i++) {
bytes = randomBytes(sizes[i]);
t0 = (new Date()).getTime();
for (j = 0; j < 3; j++) _rush.digestFromBuffer(bytes);
t1 = (new Date()).getTime();
console.log('Emitted in ' + ((t1-t0)/3) + ' milliseconds');
}

View File

@ -1,46 +0,0 @@
if (typeof require === 'function') {
var crypto = require('crypto');
var johnston = require('./bench/johnston');
var Rusha = require('../dist/rusha.js');
var cifre_utils = require('./bench/cifre/utils.js');
var cifre_sha1 = require('./bench/cifre/sha1.js');
var random = require('./random');
var fnNative = random.fnNative,
randomBytes = random.randomBytes;
}
var _rush = new Rusha(),
fnRusha = function (bytes) {
return _rush.digestFromBuffer(bytes);
};
var fnJohnston = function (bytes) {
return johnston(bytes);
};
var fnCifre = function (bytes) {
return cifre_utils.tohex(cifre_sha1(bytes));
};
var ids = ['Native ', 'Rusha ', 'Cifre '];
var fns = [fnNative, fnRusha/*, fnCifre*/];
var bench = function () {
for (size=0;size<1024*8;size++) {
// use random test data
var bytes = randomBytes(size);//"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquy".substr(0, size);
var ref = "";
fns.forEach(function (fn, i) {
var res = fn(bytes);
if (ref == "")
ref = res;
else if (ref != res)
console.log(ids[i] + ' hash mismatch on size ' + size + ': ' + res + ' expected: ' + ref);
});
if (!(size % 1000))
console.log(size);
};
}
bench();

View File

@ -1,8 +1,8 @@
{
"name": "rusha",
"version": "0.8.11",
"version": "0.8.5",
"description": "A high-performance pure-javascript SHA1 implementation suitable for large binary data.",
"main": "dist/rusha.js",
"main": "rusha.js",
"keywords": [
"sha1",
"binary",
@ -11,87 +11,52 @@
],
"scripts": {
"test": "grunt test",
"test:unit": "grunt test:unit",
"build": "grunt build",
"benchmark": "grunt benchmark"
"test-saucelabs": "grunt test-saucelabs",
"build": "grunt build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/srijs/rusha.git"
},
"devDependencies": {
"asm.js": "^0.0.2",
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.3",
"babel-plugin-transform-es2015-arrow-functions": "^6.22.0",
"babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0",
"babel-plugin-transform-es2015-block-scoping": "^6.26.0",
"babel-plugin-transform-es2015-classes": "^6.24.1",
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
"babelify": "^8.0.0",
"asm.js": "0.0.2",
"benchmark": "^1.0.0",
"brfs": "^1.4.3",
"browserify": "^14.5.0",
"browserify-derequire": "^0.9.4",
"grunt": "^1.0.1",
"grunt-browserify": "^5.2.0",
"grunt-cli": "^1.2.0",
"grunt-contrib-uglify": "^3.1.0",
"grunt-eslint": "^20.1.0",
"grunt-karma": "^2.0.0",
"karma": "^1.7.1",
"karma-benchmark": "^0.7.1",
"karma-benchmark-reporter": "^0.1.1",
"karma-browserify": "^5.1.2",
"karma-chai-plugins": "^0.9.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.0.1",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-webpack": "^2.0.6",
"blanket": "~1.1.6",
"grunt": "~0.4.5",
"grunt-browserify": "^3.5.0",
"grunt-cli": "~0.1.13",
"grunt-contrib-connect": "^0.8.0",
"grunt-contrib-uglify": "~0.5.1",
"grunt-mocha-test": "~0.11.0",
"grunt-saucelabs": "^8.3.2",
"grunt-sweet.js": "~0.1.5",
"microtime": "^2.1.1",
"mocha": "^4.0.1",
"node-forge": "^0.7.1",
"sha.js": "^2.4.9",
"strictify": "^0.2.0",
"sweetify": "^0.4.0",
"watchify": "^3.9.0",
"webpack": "^3.9.1",
"webworkify": "^1.5.0"
"mocha": "^3.0.2",
"sweet.js": "~0.7.1"
},
"testling": {
"files": "test/test.js",
"harness": "mocha-tdd",
"browsers": [
"ie/6..latest",
"chrome/22..latest",
"firefox/16..latest",
"safari/latest",
"opera/11.0..latest"
]
},
"author": {
"name": "Sam Rijs"
},
"license": "MIT",
"gitHead": "f803443f8c111ae6957de52ec286318910ce7f07",
"readmeFilename": "README.md",
"readme": "# Rusha [![Build Status](https://travis-ci.org/srijs/rusha.png?branch=master)](https://travis-ci.org/srijs/rusha)\n*A high-performance pure-javascript SHA1 implementation suitable for large binary data.*\n\n[![NPM](https://nodei.co/npm/rusha.png?downloads=true&downloadRank=true)](https://nodei.co/npm/rusha/)\n\n## Prologue: The Sad State of Javascript SHA1 implementations\n\nWhen we started experimenting with alternative upload technologies at [doctape](http://doctape.com) that required creating SHA1 hashes of the data locally on the client, it quickly became obvious that there were no performant pure-js implementations of SHA1 that worked correctly on binary data.\n\nJeff Mott's [CryptoJS](http://code.google.com/p/crypto-js/) and Brian Turek's [jsSHA](http://caligatio.github.com/jsSHA/) were both hash functions that worked correctly on ASCII strings of a small size, but didn't scale to large data and/or didn't work correctly with binary data.\n\n(On a sidenode, as of now Tim Caswell's [Cifre](http://github.com/openpeer/cifre) actually works with large binary data, as opposed to previously statet.)\n\nBy modifying Paul Johnston's [sha1.js](http://pajhome.org.uk/crypt/md5/sha1.html) slightly, it worked correctly on binary data but was unfortunately very slow, especially on V8. So a few days were invested on my side to implement a Johnston-inspired SHA1 hashing function with a heavy focus on performance.\n\nThe result of this process is Rusha, a SHA1 hash function that works flawlessly on large amounts binary data, such as binary strings or ArrayBuffers returned by the HTML5 File API, and leverages the soon-to-be-landed-in-firefox [asm.js](http://asmjs.org/spec/latest/) with whose support its within *half of native speed*!\n\n## Installing\n\n### Node.JS\n\nThere is really no point in doing this, since Node.JS already has a wonderful `crypto` module that is leveraging low-level hardware instructions to perform really nice. Your can see the comparison below in the benchmarks.\n\nRusha is available on [npm](http://npmjs.org/) via `npm install rusha`.\n\nIf you still want to do this, anyhow, just `require()` the `rusha.js` file, follow the instructions on _Using the Rusha Object_.\n\n### Browser\n\nRusha is available on [bower](http://twitter.github.com/bower/) via `bower install rusha`.\n\nIt is highly recommended to run CPU-intensive tasks in a [Web Worker](http://developer.mozilla.org/en-US/docs/DOM/Using_web_workers). To do so, just start a worker with `var worker = new Worker('rusha.js')` and start sending it jobs. Follow the instructions on _Using the Rusha Worker_.\n\nIf you can't, for any reason, use Web Workers, include the `rusha.js` file in a `<script>` tag and follow the instructions on _Using the Rusha Object_.\n\n## Using the Rusha Object\n\nYour instantiate a new Rusha object by doing `var r = new Rusha(optionalSizeHint)`. When created, it provides the following methods:\n\n- `Rusha#digest(d)`: Create a hex digest from data of the three kinds mentioned below, or throw and error if the type is unsupported.\n- `Rusha#digestFromString(s)`: Create a hex digest from a binary `String`. A binary string is expected to only contain characters whose charCode < 256.\n- `Rusha#digestFromBuffer(b)`: Create a hex digest from a `Buffer` or `Array`. Both are expected to only contain elements < 256.\n- `Rusha#digestFromArrayBuffer(a)`: Create a hex digest from an `ArrayBuffer` object.\n- `Rusha#rawDigest(d)`: Behaves just like #digest(d), except that it returns the digest as an Int32Array of size 5.\n\n## Using the Rusha Worker\n\nYou can send your instance of the web worker messages in the format `{id: jobid, data: dataobject}`. The worker then sends back a message in the format `{id: jobid, hash: hash}`, were jobid is the id of the job previously received and hash is the hash of the data-object you passed, be it a `Blob`, `Array`, `Buffer`, `ArrayBuffer` or `String`.\n\n## Development\n\n* Download npm dependencies with `npm install`\n* Source file to be edited is `rusha.sweet.js`\n* Build with `npm run build`\n* Run tests with `npm test`\n\n## Benchmarks\n\nTested were my Rusha implementation, the sha1.js implementation by [P. A. Johnston](http://pajhome.org.uk/crypt/md5/sha1.html), Tim Caswell's [Cifre](http://github.com/openpeer/cifre) and the Node.JS native implementation.\n\nIf you want to check the performance for yourself in your own browser, I compiled a [JSPerf Page](http://jsperf.com/rusha/13).\n\nA normalized estimation based on the best results for each implementation, smaller is better:\n![rough performance graph](http://srijs.github.io/rusha/bench/unscientific01.png)\n\nResults per Implementation and Platform:\n![performance chart](https://docs.google.com/spreadsheet/oimg?key=0Ag9CYh5kHpegdDB1ZG16WU1xVFgxdjRuQUVwQXRnWVE&oid=1&zx=pcatr2aits9)\n\nAll tests were performed on a MacBook Air 1.7 GHz Intel Core i5 and 4 GB 1333 MHz DDR3.\n",
"bugs": {
"url": "https://github.com/srijs/rusha/issues"
},
"homepage": "https://github.com/srijs/rusha#readme",
"_id": "rusha@0.8.11",
"_shasum": "caa8963b1dbfd229d90626dd3f2a784430d6058d",
"_from": "rusha@>=0.8.3 <0.9.0",
"_npmVersion": "4.2.0",
"_nodeVersion": "7.10.0",
"_npmUser": {
"name": "srijs",
"email": "srijs@airpost.net"
},
"dist": {
"shasum": "caa8963b1dbfd229d90626dd3f2a784430d6058d",
"tarball": "https://registry.npmjs.org/rusha/-/rusha-0.8.11.tgz"
},
"maintainers": [
{
"name": "srijs",
"email": "recv@awesam.de"
}
],
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/rusha-0.8.11.tgz_1515062493716_0.7024806872941554"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/rusha/-/rusha-0.8.11.tgz",
"readme": "ERROR: No README data found!"
"_id": "rusha@0.8.5",
"_shasum": "a30ae9bd5a4e80fbc96fbe7a13232b944be24f84",
"_resolved": "https://registry.npmjs.org/rusha/-/rusha-0.8.5.tgz",
"_from": "rusha@0.8.5"
}

View File

@ -1,22 +0,0 @@
const shajs = require('sha.js');
const forge = require('node-forge');
const Rusha = require('../dist/rusha.min.js');
suite('SHA1 4MB', () => {
const bytes = new Uint8Array(2 * 1024 * 1024);
benchmark('rusha', () => {
Rusha.createHash().update(bytes).digest();
});
benchmark('sha.js', () => {
shajs('sha1').update(bytes).digest();
});
benchmark('node-forge', () => {
const md = forge.md.sha1.create();
md.update(bytes);
md.digest();
});
});

494
lib/rusha/rusha.js Normal file
View File

@ -0,0 +1,494 @@
(function () {
var /*
* Rusha, a JavaScript implementation of the Secure Hash Algorithm, SHA-1,
* as defined in FIPS PUB 180-1, tuned for high performance with large inputs.
* (http://github.com/srijs/rusha)
*
* Inspired by Paul Johnstons implementation (http://pajhome.org.uk/crypt/md5).
*
* Copyright (c) 2013 Sam Rijs (http://awesam.de).
* Released under the terms of the MIT license as follows:
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
util = {
getDataType: function (data) {
if (typeof data === 'string') {
return 'string';
}
if (data instanceof Array) {
return 'array';
}
if (typeof global !== 'undefined' && 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.');
}
};
function Rusha(chunkSize) {
'use strict';
var // Private object structure.
self$2 = { fill: 0 };
var // Calculate the length of buffer that the sha1 routine uses
// including the padding.
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$2 = (len >> 2) + 1; i$2 < bin.length; i$2++)
bin[i$2] = 0;
};
var padData = function (bin, chunkLen, msgLen) {
bin[chunkLen >> 2] |= 128 << 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 & ~15) + 14] = msgLen / (1 << 29) | 0;
bin[((chunkLen >> 2) + 2 & ~15) + 15] = msgLen << 3;
};
var // Convert a binary string and write it to the heap.
// A binary string is expected to only contain char codes < 256.
convStr = function (H8, H32, start, len, off) {
var str = this, i$2, 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$2 = 4 - om; i$2 < j; i$2 = i$2 + 4 | 0) {
H32[off + i$2 >> 2] = str.charCodeAt(start + i$2) << 24 | str.charCodeAt(start + i$2 + 1) << 16 | str.charCodeAt(start + i$2 + 2) << 8 | str.charCodeAt(start + i$2 + 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);
}
};
var // Convert a buffer or array and write it to the heap.
// The buffer or array is expected to only contain elements < 256.
convBuf = function (H8, H32, start, len, off) {
var buf = this, i$2, 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$2 = 4 - om; i$2 < j; i$2 = i$2 + 4 | 0) {
H32[off + i$2 >> 2 | 0] = buf[start + i$2] << 24 | buf[start + i$2 + 1] << 16 | buf[start + i$2 + 2] << 8 | buf[start + i$2 + 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$2, 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$2 = 4 - om; i$2 < j; i$2 = i$2 + 4 | 0) {
H32[off + i$2 >> 2 | 0] = buf[i$2] << 24 | buf[i$2 + 1] << 16 | buf[i$2 + 2] << 8 | buf[i$2 + 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 (util.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);
}
};
var slice = function (data, offset) {
switch (util.getDataType(data)) {
case 'string':
return data.slice(offset);
case 'array':
return data.slice(offset);
case 'buffer':
return data.slice(offset);
case 'arraybuffer':
return data.slice(offset);
case 'view':
return data.buffer.slice(offset);
}
};
var // Precompute 00 - ff strings
precomputedHex = new Array(256);
for (var i = 0; i < 256; i++) {
precomputedHex[i] = (i < 16 ? '0' : '') + i.toString(16);
}
var // Convert an ArrayBuffer into its hexadecimal string representation.
hex = function (arrayBuffer) {
var binarray = new Uint8Array(arrayBuffer);
var res = new Array(arrayBuffer.byteLength);
for (var i$2 = 0; i$2 < res.length; i$2++) {
res[i$2] = precomputedHex[binarray[i$2]];
}
return res.join('');
};
var 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 (// If v is smaller than 2^16, the smallest possible solution
// is 2^16.
v <= 65536)
return 65536;
if (// If v < 2^24, we round up to 2^n,
// otherwise we round up to 2^24 * n.
v < 16777216) {
for (p = 1; p < v; p = p << 1);
} else {
for (p = 16777216; p < v; p += 16777216);
}
return p;
};
var // Initialize the internal data structures to a new capacity.
init = function (size) {
if (size % 64 > 0) {
throw new Error('Chunk size must be a multiple of 128 bit');
}
self$2.offset = 0;
self$2.maxChunkLen = size;
self$2.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$2.heap = new ArrayBuffer(ceilHeapSize(self$2.padMaxChunkLen + 320 + 20));
self$2.h32 = new Int32Array(self$2.heap);
self$2.h8 = new Int8Array(self$2.heap);
self$2.core = new Rusha._core({
Int32Array: Int32Array,
DataView: DataView
}, {}, self$2.heap);
self$2.buffer = null;
};
// Iinitializethe datastructures according
// to a chunk siyze.
init(chunkSize || 64 * 1024);
var initState = function (heap, padMsgLen) {
self$2.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$2.heap, 0, padChunkLen >> 2);
padZeroes(view, chunkLen);
padData(view, chunkLen, msgLen);
return padChunkLen;
};
var // Write data to the heap.
write = function (data, chunkOffset, chunkLen, off) {
convFn(data)(self$2.h8, self$2.h32, chunkOffset, chunkLen, off || 0);
};
var // Initialize and call the RushaCore,
// assuming an input buffer of length len * 4.
coreCall = function (data, chunkOffset, chunkLen, msgLen, finalize) {
var padChunkLen = chunkLen;
write(data, chunkOffset, chunkLen);
if (finalize) {
padChunkLen = padChunk(chunkLen, msgLen);
}
self$2.core.hash(padChunkLen, self$2.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;
};
var // Calculate the hash digest as an array of 5 32bit integers.
rawDigest = this.rawDigest = function (str) {
var msgLen = str.byteLength || str.length || str.size || 0;
initState(self$2.heap, self$2.padMaxChunkLen);
var chunkOffset = 0, chunkLen = self$2.maxChunkLen, last;
for (chunkOffset = 0; msgLen > chunkOffset + chunkLen; chunkOffset += chunkLen) {
coreCall(str, chunkOffset, chunkLen, msgLen, false);
}
coreCall(str, chunkOffset, msgLen - chunkOffset, msgLen, true);
return getRawDigest(self$2.heap, self$2.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 hex(rawDigest(str).buffer);
};
this.resetState = function () {
initState(self$2.heap, self$2.padMaxChunkLen);
return this;
};
this.append = function (chunk) {
var chunkOffset = 0;
var chunkLen = chunk.byteLength || chunk.length || chunk.size || 0;
var turnOffset = self$2.offset % self$2.maxChunkLen;
var inputLen;
self$2.offset += chunkLen;
while (chunkOffset < chunkLen) {
inputLen = Math.min(chunkLen - chunkOffset, self$2.maxChunkLen - turnOffset);
write(chunk, chunkOffset, inputLen, turnOffset);
turnOffset += inputLen;
chunkOffset += inputLen;
if (turnOffset === self$2.maxChunkLen) {
self$2.core.hash(self$2.maxChunkLen, self$2.padMaxChunkLen);
turnOffset = 0;
}
}
return this;
};
this.getState = function () {
var turnOffset = self$2.offset % self$2.maxChunkLen;
var heap;
if (!turnOffset) {
var io = new Int32Array(self$2.heap, self$2.padMaxChunkLen + 320, 5);
heap = io.buffer.slice(io.byteOffset, io.byteOffset + io.byteLength);
} else {
heap = self$2.heap.slice(0);
}
return {
offset: self$2.offset,
heap: heap
};
};
this.setState = function (state) {
self$2.offset = state.offset;
if (state.heap.byteLength === 20) {
var io = new Int32Array(self$2.heap, self$2.padMaxChunkLen + 320, 5);
io.set(new Int32Array(state.heap));
} else {
self$2.h32.set(new Int32Array(state.heap));
}
return this;
};
var rawEnd = this.rawEnd = function () {
var msgLen = self$2.offset;
var chunkLen = msgLen % self$2.maxChunkLen;
var padChunkLen = padChunk(chunkLen, msgLen);
self$2.core.hash(padChunkLen, self$2.padMaxChunkLen);
var result = getRawDigest(self$2.heap, self$2.padMaxChunkLen);
initState(self$2.heap, self$2.padMaxChunkLen);
return result;
};
this.end = function () {
return hex(rawEnd().buffer);
};
}
;
// 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.
Rusha._core = function RushaCore(stdlib, foreign, heap) {
'use asm';
var H = new stdlib.Int32Array(heap);
function hash(k, x) {
// k in bytes
k = k | 0;
x = x | 0;
var i = 0, j = 0, y0 = 0, z0 = 0, y1 = 0, z1 = 0, y2 = 0, z2 = 0, y3 = 0, z3 = 0, y4 = 0, z4 = 0, t0 = 0, t1 = 0;
y0 = H[x + 320 >> 2] | 0;
y1 = H[x + 324 >> 2] | 0;
y2 = H[x + 328 >> 2] | 0;
y3 = H[x + 332 >> 2] | 0;
y4 = H[x + 336 >> 2] | 0;
for (i = 0; (i | 0) < (k | 0); i = i + 64 | 0) {
z0 = y0;
z1 = y1;
z2 = y2;
z3 = y3;
z4 = y4;
for (j = 0; (j | 0) < 64; j = j + 4 | 0) {
t1 = H[i + j >> 2] | 0;
t0 = ((y0 << 5 | y0 >>> 27) + (y1 & y2 | ~y1 & y3) | 0) + ((t1 + y4 | 0) + 1518500249 | 0) | 0;
y4 = y3;
y3 = y2;
y2 = y1 << 30 | y1 >>> 2;
y1 = y0;
y0 = t0;
H[k + j >> 2] = t1;
}
for (j = k + 64 | 0; (j | 0) < (k + 80 | 0); j = j + 4 | 0) {
t1 = (H[j - 12 >> 2] ^ H[j - 32 >> 2] ^ H[j - 56 >> 2] ^ H[j - 64 >> 2]) << 1 | (H[j - 12 >> 2] ^ H[j - 32 >> 2] ^ H[j - 56 >> 2] ^ H[j - 64 >> 2]) >>> 31;
t0 = ((y0 << 5 | y0 >>> 27) + (y1 & y2 | ~y1 & y3) | 0) + ((t1 + y4 | 0) + 1518500249 | 0) | 0;
y4 = y3;
y3 = y2;
y2 = y1 << 30 | y1 >>> 2;
y1 = y0;
y0 = t0;
H[j >> 2] = t1;
}
for (j = k + 80 | 0; (j | 0) < (k + 160 | 0); j = j + 4 | 0) {
t1 = (H[j - 12 >> 2] ^ H[j - 32 >> 2] ^ H[j - 56 >> 2] ^ H[j - 64 >> 2]) << 1 | (H[j - 12 >> 2] ^ H[j - 32 >> 2] ^ H[j - 56 >> 2] ^ H[j - 64 >> 2]) >>> 31;
t0 = ((y0 << 5 | y0 >>> 27) + (y1 ^ y2 ^ y3) | 0) + ((t1 + y4 | 0) + 1859775393 | 0) | 0;
y4 = y3;
y3 = y2;
y2 = y1 << 30 | y1 >>> 2;
y1 = y0;
y0 = t0;
H[j >> 2] = t1;
}
for (j = k + 160 | 0; (j | 0) < (k + 240 | 0); j = j + 4 | 0) {
t1 = (H[j - 12 >> 2] ^ H[j - 32 >> 2] ^ H[j - 56 >> 2] ^ H[j - 64 >> 2]) << 1 | (H[j - 12 >> 2] ^ H[j - 32 >> 2] ^ H[j - 56 >> 2] ^ H[j - 64 >> 2]) >>> 31;
t0 = ((y0 << 5 | y0 >>> 27) + (y1 & y2 | y1 & y3 | y2 & y3) | 0) + ((t1 + y4 | 0) - 1894007588 | 0) | 0;
y4 = y3;
y3 = y2;
y2 = y1 << 30 | y1 >>> 2;
y1 = y0;
y0 = t0;
H[j >> 2] = t1;
}
for (j = k + 240 | 0; (j | 0) < (k + 320 | 0); j = j + 4 | 0) {
t1 = (H[j - 12 >> 2] ^ H[j - 32 >> 2] ^ H[j - 56 >> 2] ^ H[j - 64 >> 2]) << 1 | (H[j - 12 >> 2] ^ H[j - 32 >> 2] ^ H[j - 56 >> 2] ^ H[j - 64 >> 2]) >>> 31;
t0 = ((y0 << 5 | y0 >>> 27) + (y1 ^ y2 ^ y3) | 0) + ((t1 + y4 | 0) - 899497514 | 0) | 0;
y4 = y3;
y3 = y2;
y2 = y1 << 30 | y1 >>> 2;
y1 = y0;
y0 = t0;
H[j >> 2] = t1;
}
y0 = y0 + z0 | 0;
y1 = y1 + z1 | 0;
y2 = y2 + z2 | 0;
y3 = y3 + z3 | 0;
y4 = y4 + z4 | 0;
}
H[x + 320 >> 2] = y0;
H[x + 324 >> 2] = y1;
H[x + 328 >> 2] = y2;
H[x + 332 >> 2] = y3;
H[x + 336 >> 2] = y4;
}
return { hash: hash };
};
if (// If we'e running in Node.JS, export a module.
typeof module !== 'undefined') {
module.exports = Rusha;
} else if (// If we're running in a DOM context, export
// the Rusha object to toplevel.
typeof window !== 'undefined') {
window.Rusha = Rusha;
}
if (// If we're running in a webworker, accept
// messages containing a jobid and a buffer
// or blob object, and return the hash result.
typeof FileReaderSync !== 'undefined') {
var reader = new FileReaderSync(), hasher = new Rusha(4 * 1024 * 1024);
self.onmessage = function onMessage(event) {
var hash, data = event.data.data;
try {
hash = hasher.digest(data);
self.postMessage({
id: event.data.id,
hash: hash
});
} catch (e) {
self.postMessage({
id: event.data.id,
error: e.name
});
}
};
}
}());

2
lib/rusha/rusha.min.js vendored Normal file

File diff suppressed because one or more lines are too long

525
lib/rusha/rusha.sweet.js Normal file
View File

@ -0,0 +1,525 @@
/*
* Rusha, a JavaScript implementation of the Secure Hash Algorithm, SHA-1,
* as defined in FIPS PUB 180-1, tuned for high performance with large inputs.
* (http://github.com/srijs/rusha)
*
* Inspired by Paul Johnstons implementation (http://pajhome.org.uk/crypt/md5).
*
* Copyright (c) 2013 Sam Rijs (http://awesam.de).
* Released under the terms of the MIT license as follows:
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
(function () {
var util = {
getDataType: function (data) {
if (typeof data === 'string') {
return 'string';
}
if (data instanceof Array) {
return 'array';
}
if (typeof global !== 'undefined' && 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.');
}
};
// 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.
function Rusha (chunkSize) {
"use strict";
// Private object structure.
var self = {fill: 0};
// 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 (util.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);
}
};
var slice = function (data, offset) {
switch (util.getDataType(data)) {
case 'string': return data.slice(offset);
case 'array': return data.slice(offset);
case 'buffer': return data.slice(offset);
case 'arraybuffer': return data.slice(offset);
case 'view': return data.buffer.slice(offset);
}
};
// Precompute 00 - ff strings
var precomputedHex = new Array(256);
for (var i = 0; i < 256; i++) {
precomputedHex[i] = (i < 0x10 ? '0' : '') + i.toString(16);
}
// Convert an ArrayBuffer into its hexadecimal string representation.
var hex = 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('');
};
var 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;
};
// 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(ceilHeapSize(self.padMaxChunkLen + 320 + 20));
self.h32 = new Int32Array(self.heap);
self.h8 = new Int8Array(self.heap);
self.core = new Rusha._core({Int32Array: Int32Array, DataView: DataView}, {}, 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, last;
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 hex(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 hex(rawEnd().buffer);
};
};
macro rol1 { rule { ($v:expr) } => { ($v << 1 | $v >>> 31) } }
macro rol5 { rule { ($v:expr) } => { ($v << 5 | $v >>> 27) } }
macro rol30 { rule { ($v:expr) } => { ($v << 30 | $v >>> 2) } }
macro extended {
rule { ($H, $j:expr) } => {
rol1($H[$j-12>>2] ^ $H[$j-32>>2] ^ $H[$j-56>>2] ^ $H[$j-64>>2])
}
}
macro F0 { rule { ($b,$c,$d) } => { ($b & $c | ~$b & $d) } }
macro F1 { rule { ($b,$c,$d) } => { ($b ^ $c ^ $d) }}
macro F2 { rule { ($b,$c,$d) } => { ($b & $c | $b & $d | $c & $d) }}
macro swap {
rule { ($y0, $y1, $y2, $y3, $y4, $t0) } => {
$y4 = $y3;
$y3 = $y2;
$y2 = rol30($y1);
$y1 = $y0;
$y0 = $t0;
}
}
macro roundL { rule { ($y0, $f:expr) } => { (rol5($y0) + $f |0) } }
macro roundR { rule { ($y4, $t1) } => { ($t1 + $y4 |0) } }
// 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.
Rusha._core = function RushaCore (stdlib, foreign, heap) {
"use asm";
var H = new stdlib.Int32Array(heap);
function hash (k, x) { // k in bytes
k = k|0;
x = x|0;
var i = 0, j = 0,
y0 = 0, z0 = 0, y1 = 0, z1 = 0,
y2 = 0, z2 = 0, y3 = 0, z3 = 0,
y4 = 0, z4 = 0, t0 = 0, t1 = 0;
y0 = H[x+320>>2]|0;
y1 = H[x+324>>2]|0;
y2 = H[x+328>>2]|0;
y3 = H[x+332>>2]|0;
y4 = H[x+336>>2]|0;
for (i = 0; (i|0) < (k|0); i = i + 64 |0) {
z0 = y0;
z1 = y1;
z2 = y2;
z3 = y3;
z4 = y4;
for (j = 0; (j|0) < 64; j = j + 4 |0) {
t1 = H[i+j>>2]|0;
t0 = roundL(y0, F0(y1, y2, y3)) + (roundR(y4, t1) + 1518500249 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[k+j>>2] = t1;
}
for (j = k + 64 |0; (j|0) < (k + 80 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F0(y1, y2, y3)) + (roundR(y4, t1) + 1518500249 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
for (j = k + 80 |0; (j|0) < (k + 160 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F1(y1, y2, y3)) + (roundR(y4, t1) + 1859775393 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
for (j = k + 160 |0; (j|0) < (k + 240 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F2(y1, y2, y3)) + (roundR(y4, t1) - 1894007588 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
for (j = k + 240 |0; (j|0) < (k + 320 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F1(y1, y2, y3)) + (roundR(y4, t1) - 899497514 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
y0 = y0 + z0 |0;
y1 = y1 + z1 |0;
y2 = y2 + z2 |0;
y3 = y3 + z3 |0;
y4 = y4 + z4 |0;
}
H[x+320>>2] = y0;
H[x+324>>2] = y1;
H[x+328>>2] = y2;
H[x+332>>2] = y3;
H[x+336>>2] = y4;
}
return {hash: hash};
}
// If we'e running in Node.JS, export a module.
if (typeof module !== 'undefined') {
module.exports = Rusha;
}
// If we're running in a DOM context, export
// the Rusha object to toplevel.
else if (typeof window !== 'undefined') {
window.Rusha = Rusha;
}
// If we're running in a webworker, accept
// messages containing a jobid and a buffer
// or blob object, and return the hash result.
if (typeof FileReaderSync !== 'undefined') {
var reader = new FileReaderSync(),
hasher = new Rusha(4 * 1024 * 1024);
self.onmessage = function onMessage (event) {
var hash, data = event.data.data;
try {
hash = hasher.digest(data);
self.postMessage({id: event.data.id, hash: hash});
} catch (e) {
self.postMessage({id: event.data.id, error: e.name});
}
};
}
})();

View File

@ -1,105 +0,0 @@
/* eslint-env commonjs, browser */
let reader;
if (typeof self !== 'undefined' && typeof self.FileReaderSync !== 'undefined') {
reader = new self.FileReaderSync();
}
// Convert a binary string and write it to the heap.
// A binary string is expected to only contain char codes < 256.
const convStr = (str, H8, H32, start, len, off) => {
let 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 + (4-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.
const convBuf = (buf, H8, H32, start, len, off) => {
let 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 + (4-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];
}
};
const convBlob = (blob, H8, H32, start, len, off) => {
let i, om = off % 4, lm = (len + om) % 4, j = len - lm;
const 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 + (4-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];
}
};
module.exports = (data, H8, H32, start, len, off) => {
if (typeof data === 'string') {
return convStr(data, H8, H32, start, len, off);
}
if (data instanceof Array) {
return convBuf(data, H8, H32, start, len, off);
}
if (global.Buffer && global.Buffer.isBuffer(data)) {
return convBuf(data, H8, H32, start, len, off);
}
if (data instanceof ArrayBuffer) {
return convBuf(new Uint8Array(data), H8, H32, start, len, off);
}
if (data.buffer instanceof ArrayBuffer) {
return convBuf(new Uint8Array(data.buffer, data.byteOffset, data.byteLength), H8, H32, start, len, off);
}
if (data instanceof Blob) {
return convBlob(data, H8, H32, start, len, off);
}
throw new Error('Unsupported data type.');
};

View File

@ -1,114 +0,0 @@
macro rol1 { rule { ($v:expr) } => { ($v << 1 | $v >>> 31) } }
macro rol5 { rule { ($v:expr) } => { ($v << 5 | $v >>> 27) } }
macro rol30 { rule { ($v:expr) } => { ($v << 30 | $v >>> 2) } }
macro extended {
rule { ($H, $j:expr) } => {
rol1($H[$j-12>>2] ^ $H[$j-32>>2] ^ $H[$j-56>>2] ^ $H[$j-64>>2])
}
}
macro F0 { rule { ($b,$c,$d) } => { ($b & $c | ~$b & $d) } }
macro F1 { rule { ($b,$c,$d) } => { ($b ^ $c ^ $d) }}
macro F2 { rule { ($b,$c,$d) } => { ($b & $c | $b & $d | $c & $d) }}
macro swap {
rule { ($y0, $y1, $y2, $y3, $y4, $t0) } => {
$y4 = $y3;
$y3 = $y2;
$y2 = rol30($y1);
$y1 = $y0;
$y0 = $t0;
}
}
macro roundL { rule { ($y0, $f:expr) } => { (rol5($y0) + $f |0) } }
macro roundR { rule { ($y4, $t1) } => { ($t1 + $y4 |0) } }
// 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, foreign, heap) {
'use asm';
var H = new stdlib.Int32Array(heap);
function hash (k, x) { // k in bytes
k = k|0;
x = x|0;
var i = 0, j = 0,
y0 = 0, z0 = 0, y1 = 0, z1 = 0,
y2 = 0, z2 = 0, y3 = 0, z3 = 0,
y4 = 0, z4 = 0, t0 = 0, t1 = 0;
y0 = H[x+320>>2]|0;
y1 = H[x+324>>2]|0;
y2 = H[x+328>>2]|0;
y3 = H[x+332>>2]|0;
y4 = H[x+336>>2]|0;
for (i = 0; (i|0) < (k|0); i = i + 64 |0) {
z0 = y0;
z1 = y1;
z2 = y2;
z3 = y3;
z4 = y4;
for (j = 0; (j|0) < 64; j = j + 4 |0) {
t1 = H[i+j>>2]|0;
t0 = roundL(y0, F0(y1, y2, y3)) + (roundR(y4, t1) + 1518500249 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[k+j>>2] = t1;
}
for (j = k + 64 |0; (j|0) < (k + 80 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F0(y1, y2, y3)) + (roundR(y4, t1) + 1518500249 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
for (j = k + 80 |0; (j|0) < (k + 160 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F1(y1, y2, y3)) + (roundR(y4, t1) + 1859775393 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
for (j = k + 160 |0; (j|0) < (k + 240 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F2(y1, y2, y3)) + (roundR(y4, t1) - 1894007588 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
for (j = k + 240 |0; (j|0) < (k + 320 |0); j = j + 4 |0) {
t1 = extended(H, j);
t0 = roundL(y0, F1(y1, y2, y3)) + (roundR(y4, t1) - 899497514 |0) |0;
swap(y0, y1, y2, y3, y4, t0)
H[j>>2] = t1;
}
y0 = y0 + z0 |0;
y1 = y1 + z1 |0;
y2 = y2 + z2 |0;
y3 = y3 + z3 |0;
y4 = y4 + z4 |0;
}
H[x+320>>2] = y0;
H[x+324>>2] = y1;
H[x+328>>2] = y2;
H[x+332>>2] = y3;
H[x+336>>2] = y4;
}
return {hash: hash};
};

View File

@ -1,31 +0,0 @@
/* eslint-env commonjs, browser */
const Rusha = require('./rusha');
const {toHex} = require('./utils');
class Hash {
constructor() {
this._rusha = new Rusha();
this._rusha.resetState();
}
update(data) {
this._rusha.append(data);
return this;
}
digest(encoding) {
const digest = this._rusha.rawEnd().buffer;
if (!encoding) {
return digest;
}
if (encoding === 'hex') {
return toHex(digest);
}
throw new Error('unsupported digest encoding');
}
}
module.exports = () => {
return new Hash();
};

View File

@ -1,27 +0,0 @@
/* eslint-env commonjs, browser */
const webworkify = require('webworkify');
const Rusha = require('./rusha');
const createHash = require('./hash');
const runWorker = require('./worker');
const { isDedicatedWorkerScope } = require('./utils');
const isRunningInDedicatedWorker = typeof self !== 'undefined'
&& isDedicatedWorkerScope(self);
Rusha.disableWorkerBehaviour = isRunningInDedicatedWorker ? runWorker() : () => {};
Rusha.createWorker = () => {
const worker = webworkify(require('./worker'));
const terminate = worker.terminate;
worker.terminate = () => {
URL.revokeObjectURL(worker.objectURL);
terminate.call(worker);
};
return worker;
};
Rusha.createHash = createHash;
module.exports = Rusha;

View File

@ -1,192 +0,0 @@
/* eslint-env commonjs, browser */
const RushaCore = require('./core.sjs');
const {toHex, ceilHeapSize} = require('./utils');
const conv = require('./conv');
// Calculate the length of buffer that the sha1 routine uses
// including the padding.
const padlen = (len) => {
for (len += 9; len % 64 > 0; len += 1);
return len;
};
const padZeroes = (bin, len) => {
const h8 = new Uint8Array(bin.buffer);
const 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 (let i = (len >> 2) + 1; i < bin.length; i++) {
bin[i] = 0;
}
};
const padData = (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;
};
const getRawDigest = (heap, padMaxChunkLen) => {
const io = new Int32Array(heap, padMaxChunkLen + 320, 5);
const out = new Int32Array(5);
const 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;
};
class Rusha {
constructor(chunkSize) {
chunkSize = chunkSize || 64 * 1024;
if (chunkSize % 64 > 0) {
throw new Error('Chunk size must be a multiple of 128 bit');
}
this._offset = 0;
this._maxChunkLen = chunkSize;
this._padMaxChunkLen = padlen(chunkSize);
// 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
this._heap = new ArrayBuffer(ceilHeapSize(this._padMaxChunkLen + 320 + 20));
this._h32 = new Int32Array(this._heap);
this._h8 = new Int8Array(this._heap);
this._core = new RushaCore({Int32Array: Int32Array}, {}, this._heap);
}
_initState(heap, padMsgLen) {
this._offset = 0;
const io = new Int32Array(heap, padMsgLen + 320, 5);
io[0] = 1732584193;
io[1] = -271733879;
io[2] = -1732584194;
io[3] = 271733878;
io[4] = -1009589776;
}
_padChunk(chunkLen, msgLen) {
const padChunkLen = padlen(chunkLen);
const view = new Int32Array(this._heap, 0, padChunkLen >> 2);
padZeroes(view, chunkLen);
padData(view, chunkLen, msgLen);
return padChunkLen;
}
_write(data, chunkOffset, chunkLen, off) {
conv(data, this._h8, this._h32, chunkOffset, chunkLen, off || 0);
}
_coreCall(data, chunkOffset, chunkLen, msgLen, finalize) {
let padChunkLen = chunkLen;
this._write(data, chunkOffset, chunkLen);
if (finalize) {
padChunkLen = this._padChunk(chunkLen, msgLen);
}
this._core.hash(padChunkLen, this._padMaxChunkLen);
}
rawDigest(str) {
const msgLen = str.byteLength || str.length || str.size || 0;
this._initState(this._heap, this._padMaxChunkLen);
let chunkOffset = 0, chunkLen = this._maxChunkLen;
for (chunkOffset = 0; msgLen > chunkOffset + chunkLen; chunkOffset += chunkLen) {
this._coreCall(str, chunkOffset, chunkLen, msgLen, false);
}
this._coreCall(str, chunkOffset, msgLen - chunkOffset, msgLen, true);
return getRawDigest(this._heap, this._padMaxChunkLen);
}
digest(str) {
return toHex(this.rawDigest(str).buffer);
}
digestFromString(str) {
return this.digest(str);
}
digestFromBuffer(str) {
return this.digest(str);
}
digestFromArrayBuffer(str) {
return this.digest(str);
}
resetState() {
this._initState(this._heap, this._padMaxChunkLen);
return this;
}
append(chunk) {
let chunkOffset = 0;
let chunkLen = chunk.byteLength || chunk.length || chunk.size || 0;
let turnOffset = this._offset % this._maxChunkLen;
let inputLen;
this._offset += chunkLen;
while (chunkOffset < chunkLen) {
inputLen = Math.min(chunkLen - chunkOffset, this._maxChunkLen - turnOffset);
this._write(chunk, chunkOffset, inputLen, turnOffset);
turnOffset += inputLen;
chunkOffset += inputLen;
if (turnOffset === this._maxChunkLen) {
this._core.hash(this._maxChunkLen, this._padMaxChunkLen);
turnOffset = 0;
}
}
return this;
}
getState() {
const turnOffset = this._offset % this._maxChunkLen;
let heap;
if (!turnOffset) {
const io = new Int32Array(this._heap, this._padMaxChunkLen + 320, 5);
heap = io.buffer.slice(io.byteOffset, io.byteOffset + io.byteLength);
} else {
heap = this._heap.slice(0);
}
return {
offset: this._offset,
heap: heap
};
}
setState(state) {
this._offset = state.offset;
if (state.heap.byteLength === 20) {
const io = new Int32Array(this._heap, this._padMaxChunkLen + 320, 5);
io.set(new Int32Array(state.heap));
} else {
this._h32.set(new Int32Array(state.heap));
}
return this;
}
rawEnd() {
const msgLen = this._offset;
const chunkLen = msgLen % this._maxChunkLen;
const padChunkLen = this._padChunk(chunkLen, msgLen);
this._core.hash(padChunkLen, this._padMaxChunkLen);
const result = getRawDigest(this._heap, this._padMaxChunkLen);
this._initState(this._heap, this._padMaxChunkLen);
return result;
}
end() {
return toHex(this.rawEnd().buffer);
}
}
module.exports = Rusha;
module.exports._core = RushaCore;

View File

@ -1,68 +0,0 @@
/* eslint-env commonjs, browser */
//
// toHex
//
const precomputedHex = new Array(256);
for (let i = 0; i < 256; i++) {
precomputedHex[i] = (i < 0x10 ? '0' : '') + i.toString(16);
}
module.exports.toHex = (arrayBuffer) => {
const binarray = new Uint8Array(arrayBuffer);
const res = new Array(arrayBuffer.byteLength);
for (let i = 0; i < res.length; i++) {
res[i] = precomputedHex[binarray[i]];
}
return res.join('');
};
//
// ceilHeapSize
//
module.exports.ceilHeapSize = (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.
let p = 0;
// 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;
};
//
// isDedicatedWorkerScope
//
module.exports.isDedicatedWorkerScope = (self) => {
const isRunningInWorker = 'WorkerGlobalScope' in self
&& self instanceof self.WorkerGlobalScope;
const isRunningInSharedWorker = 'SharedWorkerGlobalScope' in self
&& self instanceof self.SharedWorkerGlobalScope;
const isRunningInServiceWorker = 'ServiceWorkerGlobalScope' in self
&& self instanceof self.ServiceWorkerGlobalScope;
// Detects whether we run inside a dedicated worker or not.
//
// We can't just check for `DedicatedWorkerGlobalScope`, since IE11
// has a bug where it only supports `WorkerGlobalScope`.
//
// Therefore, we consider us as running inside a dedicated worker
// when we are running inside a worker, but not in a shared or service worker.
//
// When new types of workers are introduced, we will need to adjust this code.
return isRunningInWorker
&& !isRunningInSharedWorker
&& !isRunningInServiceWorker;
};

View File

@ -1,65 +0,0 @@
/* eslint-env commonjs, worker */
module.exports = () => {
const Rusha = require('./rusha');
const hashData = (hasher, data, cb) => {
try {
return cb(null, hasher.digest(data));
} catch (e) {
return cb(e);
}
};
const hashFile = (hasher, readTotal, blockSize, file, cb) => {
const reader = new self.FileReader();
reader.onloadend = function onloadend () {
if (reader.error) {
return cb(reader.error);
}
const 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));
};
let workerBehaviourEnabled = true;
self.onmessage = (event) => {
if (!workerBehaviourEnabled) {
return;
}
const data = event.data.data, file = event.data.file, id = event.data.id;
if (typeof id === 'undefined') return;
if (!file && !data) return;
const blockSize = event.data.blockSize || (4 * 1024 * 1024);
const hasher = new Rusha(blockSize);
hasher.resetState();
const 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 () => {
workerBehaviourEnabled = false;
};
};

View File

@ -44,34 +44,14 @@
"legacy-streams.js",
"polyfills.js"
],
"gitHead": "65cf80d1fd3413b823c16c626c1e7c326452bee5",
"readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over [fs module](https://nodejs.org/api/fs.html)\n\n* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n\n## USAGE\n\n```javascript\n// use just like fs\nvar fs = require('graceful-fs')\n\n// now go and do stuff with it...\nfs.readFileSync('some-file-or-whatever')\n```\n\n## Global Patching\n\nIf you want to patch the global fs module (or any other fs-like\nmodule) you can do this:\n\n```javascript\n// Make sure to read the caveat below.\nvar realFs = require('fs')\nvar gracefulFs = require('graceful-fs')\ngracefulFs.gracefulify(realFs)\n```\n\nThis should only ever be done at the top-level application layer, in\norder to delay on EMFILE errors from any fs-using dependencies. You\nshould **not** do this in a library, because it can cause unexpected\ndelays in other parts of the program.\n\n## Changes\n\nThis module is fairly stable at this point, and used by a lot of\nthings. That being said, because it implements a subtle behavior\nchange in a core part of the node API, even modest changes can be\nextremely breaking, and the versioning is thus biased towards\nbumping the major when in doubt.\n\nThe main change between major versions has been switching between\nproviding a fully-patched `fs` module vs monkey-patching the node core\nbuiltin, and the approach by which a non-monkey-patched `fs` was\ncreated.\n\nThe goal is to trade `EMFILE` errors for slower fs operations. So, if\nyou try to open a zillion files, rather than crashing, `open`\noperations will be queued up and wait for something else to `close`.\n\nThere are advantages to each approach. Monkey-patching the fs means\nthat no `EMFILE` errors can possibly occur anywhere in your\napplication, because everything is using the same core `fs` module,\nwhich is patched. However, it can also obviously cause undesirable\nside-effects, especially if the module is loaded multiple times.\n\nImplementing a separate-but-identical patched `fs` module is more\nsurgical (and doesn't run the risk of patching multiple times), but\nalso imposes the challenge of keeping in sync with the core module.\n\nThe current approach loads the `fs` module, and then creates a\nlookalike object that has all the same methods, except a few that are\npatched. It is safe to use in all versions of Node from 0.8 through\n7.0.\n\n### v4\n\n* Do not monkey-patch the fs module. This module may now be used as a\n drop-in dep, and users can opt into monkey-patching the fs builtin\n if their app requires it.\n\n### v3\n\n* Monkey-patch fs, because the eval approach no longer works on recent\n node.\n* fixed possible type-error throw if rename fails on windows\n* verify that we *never* get EMFILE errors\n* Ignore ENOSYS from chmod/chown\n* clarify that graceful-fs must be used as a drop-in\n\n### v2.1.0\n\n* Use eval rather than monkey-patching fs.\n* readdir: Always sort the results\n* win32: requeue a file if error has an OK status\n\n### v2.0\n\n* A return to monkey patching\n* wrap process.cwd\n\n### v1.1\n\n* wrap readFile\n* Wrap fs.writeFile.\n* readdir protection\n* Don't clobber the fs builtin\n* Handle fs.read EAGAIN errors by trying again\n* Expose the curOpen counter\n* No-op lchown/lchmod if not implemented\n* fs.rename patch only for win32\n* Patch fs.rename to handle AV software on Windows\n* Close #4 Chown should not fail on einval or eperm if non-root\n* Fix isaacs/fstream#1 Only wrap fs one time\n* Fix #3 Start at 1024 max files, then back off on EMFILE\n* lutimes that doens't blow up on Linux\n* A full on-rewrite using a queue instead of just swallowing the EMFILE error\n* Wrap Read/Write streams as well\n\n### 1.0\n\n* Update engines for node 0.6\n* Be lstat-graceful on Windows\n* first\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/node-graceful-fs/issues"
},
"homepage": "https://github.com/isaacs/node-graceful-fs#readme",
"_id": "graceful-fs@4.1.11",
"_shasum": "0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658",
"_from": "graceful-fs@>=4.1.2 <5.0.0",
"_npmVersion": "3.10.9",
"_nodeVersion": "6.5.0",
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
"dist": {
"shasum": "0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658",
"tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz"
},
"maintainers": [
{
"name": "isaacs",
"email": "i@izs.me"
}
],
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/graceful-fs-4.1.11.tgz_1479843029430_0.2122855328489095"
},
"_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
"readme": "ERROR: No README data found!"
"_from": "graceful-fs@>=4.1.2 <5.0.0"
}

View File

@ -31,25 +31,10 @@
"mocha": "^1.20.1",
"should": "^4.0.4"
},
"gitHead": "b90785340f2adf4eed77c59bdda7742a51d16e5e",
"readme": "# memory-fs\r\n\r\nA simple in-memory filesystem. Holds data in a javascript object.\r\n\r\n``` javascript\r\nvar MemoryFileSystem = require(\"memory-fs\");\r\nvar fs = new MemoryFileSystem(); // Optionally pass a javascript object\r\n\r\nfs.mkdirpSync(\"/a/test/dir\");\r\nfs.writeFileSync(\"/a/test/dir/file.txt\", \"Hello World\");\r\nfs.readFileSync(\"/a/test/dir/file.txt\"); // returns Buffer(\"Hello World\")\r\n\r\n// Async variantes too\r\nfs.unlink(\"/a/test/dir/file.txt\", function(err) {\r\n\t// ...\r\n});\r\n\r\nfs.readdirSync(\"/a/test\"); // returns [\"dir\"]\r\nfs.statSync(\"/a/test/dir\").isDirectory(); // returns true\r\nfs.rmdirSync(\"/a/test/dir\");\r\n\r\nfs.mkdirpSync(\"C:\\\\use\\\\windows\\\\style\\\\paths\");\r\n```\r\n\r\n## License\r\n\r\nCopyright (c) 2012-2014 Tobias Koppers\r\n\r\nMIT (http://www.opensource.org/licenses/mit-license.php)\r\n",
"readmeFilename": "README.md",
"_id": "memory-fs@0.2.0",
"_shasum": "f2bb25368bc121e391c2520de92969caee0a0290",
"_from": "memory-fs@>=0.2.0 <0.3.0",
"_npmVersion": "1.4.28",
"_npmUser": {
"name": "sokra",
"email": "tobias.koppers@googlemail.com"
},
"maintainers": [
{
"name": "sokra",
"email": "tobias.koppers@googlemail.com"
}
],
"dist": {
"shasum": "f2bb25368bc121e391c2520de92969caee0a0290",
"tarball": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz"
},
"_resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz",
"readme": "ERROR: No README data found!"
"_from": "memory-fs@>=0.2.0 <0.3.0"
}

File diff suppressed because one or more lines are too long

View File

@ -37,30 +37,13 @@
"type": "git",
"url": "git://github.com/webpack/enhanced-resolve.git"
},
"gitHead": "1d14a6debbe4054f84d7d7f870ca0a1cb963f75b",
"readme": "# enhanced-resolve\r\n\r\nOffers a async require.resolve function. It's highly configurable.\r\n\r\n[documentation](https://github.com/webpack/docs/wiki)\r\n\r\n\r\n## Features\r\n\r\n* plugin system\r\n* provide a custom filesystem\r\n* sync and async node.js filesystems included\r\n\r\n\r\n## Tests\r\n\r\n``` javascript\r\nnpm test\r\n```\r\n\r\n[![Build Status](https://secure.travis-ci.org/webpack/enhanced-resolve.png?branch=master)](http://travis-ci.org/webpack/enhanced-resolve)\r\n\r\n\r\n## License\r\n\r\nCopyright (c) 2012-2013 Tobias Koppers\r\n\r\nMIT (http://www.opensource.org/licenses/mit-license.php)",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/webpack/enhanced-resolve/issues"
},
"_id": "enhanced-resolve@0.9.1",
"_shasum": "4d6e689b3725f86090927ccc86cd9f1635b89e2e",
"_from": "enhanced-resolve@>=0.9.1 <0.10.0",
"_npmVersion": "3.3.3",
"_nodeVersion": "4.0.0",
"_npmUser": {
"name": "sokra",
"email": "tobias.koppers@googlemail.com"
},
"dist": {
"shasum": "4d6e689b3725f86090927ccc86cd9f1635b89e2e",
"tarball": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz"
},
"maintainers": [
{
"name": "sokra",
"email": "tobias.koppers@googlemail.com"
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz",
"readme": "ERROR: No README data found!"
"_from": "enhanced-resolve@>=0.9.1 <0.10.0"
}

View File

@ -29,35 +29,14 @@
"inherits.js",
"inherits_browser.js"
],
"gitHead": "e05d0fb27c61a3ec687214f0476386b765364d5f",
"readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/inherits/issues"
},
"homepage": "https://github.com/isaacs/inherits#readme",
"_id": "inherits@2.0.3",
"_shasum": "633c2c83e3da42a502f52466022480f4208261de",
"_from": "inherits@>=2.0.0 <3.0.0",
"_npmVersion": "3.10.7",
"_nodeVersion": "6.5.0",
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
"dist": {
"shasum": "633c2c83e3da42a502f52466022480f4208261de",
"tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
},
"maintainers": [
{
"name": "isaacs",
"email": "i@izs.me"
}
],
"_npmOperationalInternal": {
"host": "packages-16-east.internal.npmjs.com",
"tmp": "tmp/inherits-2.0.3.tgz_1473295776489_0.08142363070510328"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"readme": "ERROR: No README data found!"
"_from": "inherits@>=2.0.0 <3.0.0"
}

View File

@ -24,35 +24,14 @@
"weak": ""
},
"license": "ISC",
"gitHead": "292048199f6d28b77fbe584279a1898e25e4c714",
"readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Keys should always be Strings or Numbers\n\nNote: this module will print warnings to `console.error` if you use a\nkey that is not a String or Number. Because items are stored in an\nobject, which coerces keys to a string, it won't go well for you if\nyou try to use a key that is not a unique string, it'll cause surprise\ncollisions. For example:\n\n```JavaScript\n// Bad Example! Dont' do this!\nvar cache = LRU()\nvar a = {}\nvar b = {}\ncache.set(a, 'this is a')\ncache.set(b, 'this is b')\nconsole.log(cache.get(a)) // prints: 'this is b'\n```\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `max`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value, maxAge)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think. `max` is optional and overrides the\n cache `max` option if provided.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n\n* `length()`\n\n Return total length of objects in cache taking into account\n `length` options function.\n\n* `itemCount`\n\n Return total quantity of objects currently in cache. Note, that\n `stale` (see options) items are returned as part of this item\n count.\n\n* `dump()`\n\n Return an array of the cache entries ready for serialization and usage\n with 'destinationCache.load(arr)`.\n\n* `load(cacheEntriesArray)`\n\n Loads another cache entries array, obtained with `sourceCache.dump()`,\n into the cache. The destination cache is reset before loading new entries\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/node-lru-cache/issues"
},
"homepage": "https://github.com/isaacs/node-lru-cache#readme",
"_id": "lru-cache@2.7.3",
"_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
"_from": "lru-cache@>=2.0.0 <3.0.0",
"_npmVersion": "3.3.2",
"_nodeVersion": "4.0.0",
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
"dist": {
"shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
"tarball": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz"
},
"maintainers": [
{
"name": "isaacs",
"email": "isaacs@npmjs.com"
},
{
"name": "othiym23",
"email": "ogd@aoaioxxysz.net"
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
"readme": "ERROR: No README data found!"
"_from": "lru-cache@>=2.0.0 <3.0.0"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -24,35 +24,14 @@
"weak": ""
},
"license": "ISC",
"gitHead": "292048199f6d28b77fbe584279a1898e25e4c714",
"readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Keys should always be Strings or Numbers\n\nNote: this module will print warnings to `console.error` if you use a\nkey that is not a String or Number. Because items are stored in an\nobject, which coerces keys to a string, it won't go well for you if\nyou try to use a key that is not a unique string, it'll cause surprise\ncollisions. For example:\n\n```JavaScript\n// Bad Example! Dont' do this!\nvar cache = LRU()\nvar a = {}\nvar b = {}\ncache.set(a, 'this is a')\ncache.set(b, 'this is b')\nconsole.log(cache.get(a)) // prints: 'this is b'\n```\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `max`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value, maxAge)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think. `max` is optional and overrides the\n cache `max` option if provided.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n\n* `length()`\n\n Return total length of objects in cache taking into account\n `length` options function.\n\n* `itemCount`\n\n Return total quantity of objects currently in cache. Note, that\n `stale` (see options) items are returned as part of this item\n count.\n\n* `dump()`\n\n Return an array of the cache entries ready for serialization and usage\n with 'destinationCache.load(arr)`.\n\n* `load(cacheEntriesArray)`\n\n Loads another cache entries array, obtained with `sourceCache.dump()`,\n into the cache. The destination cache is reset before loading new entries\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/node-lru-cache/issues"
},
"homepage": "https://github.com/isaacs/node-lru-cache#readme",
"_id": "lru-cache@2.7.3",
"_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
"_from": "lru-cache@>=2.0.0 <3.0.0",
"_npmVersion": "3.3.2",
"_nodeVersion": "4.0.0",
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
"dist": {
"shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
"tarball": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz"
},
"maintainers": [
{
"name": "isaacs",
"email": "isaacs@npmjs.com"
},
{
"name": "othiym23",
"email": "ogd@aoaioxxysz.net"
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
"readme": "ERROR: No README data found!"
"_from": "lru-cache@>=2.0.0 <3.0.0"
}

File diff suppressed because one or more lines are too long

View File

@ -37,25 +37,10 @@
"devDependencies": {
"jake": "latest"
},
"readme": "# TypeScript\r\n\r\nScalable JavaScript development with types, classes and modules.\r\n\r\n## Install\r\n\r\n npm install -g typescript\r\n\r\n## Usage\r\n\r\n tsc hello.ts\r\n \r\n\r\n## Build\r\n\r\n1. Install Node if you haven't already (http://nodejs.org/)\r\n2. Install Jake, the tool we use to build our compiler (https://github.com/mde/jake). To do this, run \"npm install -g jake\".\r\n3. To use jake, run one of the following commands: \r\n - jake local - This builds the compiler. The output is in built/local in the public directory \r\n - jake clean - deletes the build compiler \r\n - jake LKG - This replaces the LKG (last known good) version of the compiler with the built one.\r\n - This is a bootstrapping step to be executed whenever the built compiler reaches a stable state.\r\n - jake tests - This builds the test infrastructure, using the built compiler. \r\n - jake runtests - This runs the tests, using the built compiler and built test infrastructure. \r\n - You can also override the host or specify a test for this command. Use host=<hostName> or tests=<testPath>. \r\n - jake baseline-accept - This replaces the baseline test results with the results obtained from jake runtests. \r\n - jake -T lists the above commands. \r\n",
"readmeFilename": "README.txt",
"_id": "typescript@1.0.1",
"dist": {
"shasum": "e8eacde3084a091d3fe29b60ac5862252662a25a",
"tarball": "https://registry.npmjs.org/typescript/-/typescript-1.0.1.tgz"
},
"_from": "typescript@1.0.1",
"_npmVersion": "1.4.3",
"_npmUser": {
"name": "typescript",
"email": "typescript@microsoft.com"
},
"maintainers": [
{
"name": "typescript",
"email": "typescript@microsoft.com"
}
],
"directories": {},
"_shasum": "e8eacde3084a091d3fe29b60ac5862252662a25a",
"_resolved": "https://registry.npmjs.org/typescript/-/typescript-1.0.1.tgz",
"readme": "ERROR: No README data found!"
"_from": "typescript@1.0.1"
}

View File

@ -40,7 +40,6 @@
"process"
]
},
"gitHead": "39015d544d4c00c7899fea4c95c2e5bc2720e68e",
"contributors": [
{
"name": "List of Tern contributors. Updated before every release."
@ -241,6 +240,7 @@
"name": "vheon"
}
],
"gitHead": "39015d544d4c00c7899fea4c95c2e5bc2720e68e",
"readme": "# Tern\n\n[![Build Status](https://secure.travis-ci.org/ternjs/tern.png)](http://travis-ci.org/ternjs/tern)\n[![NPM version](https://img.shields.io/npm/v/tern.svg)](https://www.npmjs.org/package/tern) \n[Funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?again)](https://marijnhaverbeke.nl/fund/)\n\nThis is [Tern][1]. Tern is a stand-alone, editor-independent\nJavaScript analyzer that can be used to improve the JavaScript\nintegration of existing editors.\n\nThanks to a group of generous [crowd funders][2], Tern is open-source\nsoftware, under an MIT license.\n\nThere are currently plugins available for [Emacs][emacs] (and Emacs\n[company-mode][cmode]), [Vim][vim], [Sublime Text][st], [Eclipse (and general Java API)][ec],\n[Light Table][lt], [Atom][atom] and [gedit][gedit], and built-in support in\n[Brackets][brackets], [Edge Code][edge_code], and [CodeLite](http://codelite.org/).\n\nFor further documentation, see the [project page][1] and the\n[manual][3]. To report issues, use the\n[issue tracker](https://github.com/ternjs/tern/issues). For questions\nand documentation, see the\n[discussion forum](https://discuss.ternjs.net).\n\n[1]: http://ternjs.net\n[2]: http://www.indiegogo.com/projects/tern-intelligent-javascript-editing\n[3]: http://ternjs.net/doc/manual.html\n\n[emacs]: http://ternjs.net/doc/manual.html#emacs\n[ec]: https://github.com/angelozerr/tern.java\n[vim]: https://github.com/ternjs/tern_for_vim\n[st]: https://github.com/ternjs/tern_for_sublime\n[lt]: https://github.com/mortalapeman/LT-TernJS\n[atom]: https://atom.io/packages/atom-ternjs\n[gedit]: https://github.com/Swatinem/tern_for_gedit\n[brackets]: http://brackets.io\n[edge_code]: http://html.adobe.com/edge/code\n[cmode]: https://github.com/proofit404/company-tern\n",
"readmeFilename": "README.md",
"bugs": {
@ -248,7 +248,7 @@
},
"homepage": "https://github.com/ternjs/tern#readme",
"_id": "tern@0.16.1",
"_shasum": "4d0fce862362e232daa4e316e725a590a1dbaf7a",
"_shasum": "b6997634250250dbdcfd360d54c1e41a448d3c7d",
"_from": "git+https://github.com/cloud9ide/tern.git#39015d544d4c00c7899fea4c95c2e5bc2720e68e",
"_resolved": "git+https://github.com/cloud9ide/tern.git#39015d544d4c00c7899fea4c95c2e5bc2720e68e"
}

View File

@ -20,7 +20,7 @@
"readme": "# tern_from_ts\n\nTern signatures extracted from typescript signatures.\n\nLicense: MIT\n\nSee also https://github.com/marijnh/tern and https://github.com/borisyankov/DefinitelyTyped\n",
"readmeFilename": "README.md",
"_id": "tern_from_ts@0.0.1",
"_shasum": "c0e1abedab52cc7bcb412582dff47519be96c89e",
"_shasum": "5a27fa6a77893a3cec7463d77623e35c54f9144c",
"_from": "git+https://github.com/cloud9ide/tern_from_ts.git#66df507986bbdd63f3bc4f0c53edb39169ce4f1c",
"_resolved": "git+https://github.com/cloud9ide/tern_from_ts.git#66df507986bbdd63f3bc4f0c53edb39169ce4f1c"
}

27
node_modules/async/package.json generated vendored

File diff suppressed because one or more lines are too long

37
node_modules/base64id/package.json generated vendored
View File

@ -8,41 +8,20 @@
},
"repository": {
"type": "git",
"url": "git://github.com/faeldt/base64id.git"
"url": "git+https://github.com/faeldt/base64id.git"
},
"main": "./lib/base64id.js",
"engines": {
"node": ">= 0.4.0"
},
"_npmUser": {
"name": "faeldt_kristian",
"email": "faeldt_kristian@cyberagent.co.jp"
},
"_id": "base64id@0.1.0",
"dependencies": {},
"devDependencies": {},
"optionalDependencies": {},
"_engineSupported": true,
"_npmVersion": "1.1.16",
"_nodeVersion": "v0.6.15",
"_defaultsLoaded": true,
"dist": {
"shasum": "02ce0fdeee0cef4f40080e1e73e834f0b1bfce3f",
"tarball": "https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz"
},
"maintainers": [
{
"name": "faeldt_kristian",
"email": "faeldt_kristian@cyberagent.co.jp"
}
],
"directories": {},
"_shasum": "02ce0fdeee0cef4f40080e1e73e834f0b1bfce3f",
"_resolved": "https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz",
"_from": "base64id@>=0.1.0 <0.2.0",
"readme": "base64id\n========\n\nNode.js module that generates a base64 id.\n\nUses crypto.randomBytes when available, falls back to unsafe methods for node.js <= 0.4.\n\nTo increase performance, random bytes are buffered to minimize the number of synchronous calls to crypto.randomBytes.\n\n## Installation\n\n $ npm install mongoose\n\n## Usage\n\n var base64id = require('base64id');\n\n var id = base64id.generateId();\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/faeldt/base64id/issues"
},
"readme": "ERROR: No README data found!",
"homepage": "https://github.com/faeldt/base64id#readme"
"homepage": "https://github.com/faeldt/base64id#readme",
"_id": "base64id@0.1.0",
"_shasum": "02ce0fdeee0cef4f40080e1e73e834f0b1bfce3f",
"_resolved": "https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz",
"_from": "base64id@>=0.1.0 <0.2.0"
}

View File

@ -11,25 +11,10 @@
"should": "*"
},
"main": "index",
"readme": "\n# batch\n\n Simple async batch with concurrency control and progress reporting.\n\n## Installation\n\n```\n$ npm install batch\n```\n\n## API\n\n```js\nvar Batch = require('batch')\n , batch = new Batch;\n\nbatch.concurrency(4);\n\nids.forEach(function(id){\n batch.push(function(done){\n User.get(id, done);\n });\n});\n\nbatch.on('progress', function(e){\n\n});\n\nbatch.end(function(err, users){\n\n});\n```\n\n### Progress events\n\n Contain the \"job\" index, response value, duration information, and completion data.\n\n```js\n{ index: 1,\n value: 'bar',\n pending: 2,\n total: 3,\n complete: 2,\n percent: 66,\n start: Thu Oct 04 2012 12:25:53 GMT-0700 (PDT),\n end: Thu Oct 04 2012 12:25:53 GMT-0700 (PDT),\n duration: 0 }\n```\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2013 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
"readmeFilename": "Readme.md",
"_id": "batch@0.5.0",
"dist": {
"shasum": "fd2e05a7a5d696b4db9314013e285d8ff3557ec3",
"tarball": "https://registry.npmjs.org/batch/-/batch-0.5.0.tgz"
},
"_from": "batch@0.5.0",
"_npmVersion": "1.2.30",
"_npmUser": {
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
},
"maintainers": [
{
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
}
],
"directories": {},
"_shasum": "fd2e05a7a5d696b4db9314013e285d8ff3557ec3",
"_resolved": "https://registry.npmjs.org/batch/-/batch-0.5.0.tgz",
"readme": "ERROR: No README data found!"
"_from": "batch@0.5.0"
}

View File

@ -29,28 +29,13 @@
"engines": {
"node": "*"
},
"_id": "buffer-crc32@0.2.1",
"dist": {
"shasum": "be3e5382fc02b6d6324956ac1af98aa98b08534c",
"tarball": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz"
},
"_npmVersion": "1.1.65",
"_npmUser": {
"name": "brianloveswords",
"email": "brian@nyhacker.org"
},
"maintainers": [
{
"name": "brianloveswords",
"email": "brian@nyhacker.org"
}
],
"directories": {},
"_shasum": "be3e5382fc02b6d6324956ac1af98aa98b08534c",
"_resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz",
"_from": "buffer-crc32@0.2.1",
"readme": "# buffer-crc32\n\n[![Build Status](https://secure.travis-ci.org/brianloveswords/buffer-crc32.png?branch=master)](http://travis-ci.org/brianloveswords/buffer-crc32)\n\ncrc32 that works with binary data and fancy character sets, outputs\nbuffer, signed or unsigned data and has tests.\n\nDerived from the sample CRC implementation in the PNG specification: http://www.w3.org/TR/PNG/#D-CRCAppendix\n\n# install\n```\nnpm install buffer-crc32\n```\n\n# example\n```js\nvar crc32 = require('buffer-crc32');\n// works with buffers\nvar buf = Buffer([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00])\ncrc32(buf) // -> <Buffer 94 5a ab 4a>\n\n// has convenience methods for getting signed or unsigned ints\ncrc32.signed(buf) // -> -1805997238\ncrc32.unsigned(buf) // -> 2488970058\n\n// will cast to buffer if given a string, so you can\n// directly use foreign characters safely\ncrc32('自動販売機') // -> <Buffer cb 03 1a c5>\n\n// and works in append mode too\nvar partialCrc = crc32('hey');\nvar partialCrc = crc32(' ', partialCrc);\nvar partialCrc = crc32('sup', partialCrc);\nvar partialCrc = crc32(' ', partialCrc);\nvar finalCrc = crc32('bros', partialCrc); // -> <Buffer 47 fa 55 70>\n```\n\n# tests\nThis was tested against the output of zlib's crc32 method. You can run\nthe tests with`npm test` (requires tap)\n\n# see also\nhttps://github.com/alexgorbatchev/node-crc, `crc.buffer.crc32` also\nsupports buffer inputs and return unsigned ints (thanks @tjholowaychuk).\n\n# license\nMIT/X11\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/brianloveswords/buffer-crc32/issues"
},
"readme": "ERROR: No README data found!"
"_id": "buffer-crc32@0.2.1",
"_shasum": "be3e5382fc02b6d6324956ac1af98aa98b08534c",
"_resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz",
"_from": "buffer-crc32@0.2.1"
}

View File

@ -18,25 +18,10 @@
"bytes/index.js": "index.js"
}
},
"readme": "# node-bytes\n\n Byte string parser / formatter.\n\n## Example:\n\n```js\nbytes('1kb')\n// => 1024\n\nbytes('2mb')\n// => 2097152\n\nbytes('1gb')\n// => 1073741824\n\nbytes(1073741824)\n// => 1gb\n```\n\n## Installation\n\n```\n$ npm install bytes\n$ component install visionmedia/bytes.js\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
"readmeFilename": "Readme.md",
"_id": "bytes@0.2.1",
"dist": {
"shasum": "555b08abcb063f8975905302523e4cd4ffdfdf31",
"tarball": "https://registry.npmjs.org/bytes/-/bytes-0.2.1.tgz"
},
"_from": "bytes@0.2.1",
"_npmVersion": "1.2.14",
"_npmUser": {
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
},
"maintainers": [
{
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
}
],
"directories": {},
"_shasum": "555b08abcb063f8975905302523e4cd4ffdfdf31",
"_resolved": "https://registry.npmjs.org/bytes/-/bytes-0.2.1.tgz",
"readme": "ERROR: No README data found!"
"_from": "bytes@0.2.1"
}

View File

@ -17,25 +17,10 @@
"should": "*"
},
"main": "index",
"readme": "\n# cookie-signature\n\n Sign and unsign cookies.\n\n## Example\n\n```js\nvar cookie = require('cookie-signature');\n\nvar val = cookie.sign('hello', 'tobiiscool');\nval.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');\n\nvar val = cookie.sign('hello', 'tobiiscool');\ncookie.unsign(val, 'tobiiscool').should.equal('hello');\ncookie.unsign(val, 'luna').should.be.false;\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 LearnBoost &lt;tj@learnboost.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"readmeFilename": "Readme.md",
"_id": "cookie-signature@1.0.1",
"dist": {
"shasum": "44e072148af01e6e8e24afbf12690d68ae698ecb",
"tarball": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.1.tgz"
},
"_from": "cookie-signature@1.0.1",
"_npmVersion": "1.2.14",
"_npmUser": {
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
},
"maintainers": [
{
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
}
],
"directories": {},
"_shasum": "44e072148af01e6e8e24afbf12690d68ae698ecb",
"_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.1.tgz",
"readme": "ERROR: No README data found!"
"_from": "cookie-signature@1.0.1"
}

View File

@ -26,29 +26,14 @@
"engines": {
"node": "*"
},
"_id": "cookie@0.1.0",
"dist": {
"shasum": "90eb469ddce905c866de687efc43131d8801f9d0",
"tarball": "https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz"
},
"_from": "cookie@0.1.0",
"_npmVersion": "1.2.18",
"_npmUser": {
"name": "shtylman",
"email": "shtylman@gmail.com"
},
"maintainers": [
{
"name": "shtylman",
"email": "shtylman@gmail.com"
}
],
"directories": {},
"_shasum": "90eb469ddce905c866de687efc43131d8801f9d0",
"_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz",
"readme": "# cookie [![Build Status](https://secure.travis-ci.org/shtylman/node-cookie.png?branch=master)](http://travis-ci.org/shtylman/node-cookie) #\n\ncookie is a basic cookie parser and serializer. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers.\n\nSee [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies.\n\n## how?\n\n```\nnpm install cookie\n```\n\n```javascript\nvar cookie = require('cookie');\n\nvar hdr = cookie.serialize('foo', 'bar');\n// hdr = 'foo=bar';\n\nvar cookies = cookie.parse('foo=bar; cat=meow; dog=ruff');\n// cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' };\n```\n\n## more\n\nThe serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values.\n\n### path\n> cookie path\n\n### expires\n> absolute expiration date for the cookie (Date object)\n\n### maxAge\n> relative max age of the cookie from when the client receives it (seconds)\n\n### domain\n> domain for the cookie\n\n### secure\n> true or false\n\n### httpOnly\n> true or false\n\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/shtylman/node-cookie/issues"
},
"readme": "ERROR: No README data found!",
"homepage": "https://github.com/shtylman/node-cookie#readme"
"homepage": "https://github.com/shtylman/node-cookie#readme",
"_id": "cookie@0.1.0",
"_shasum": "90eb469ddce905c866de687efc43131d8801f9d0",
"_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz",
"_from": "cookie@0.1.0"
}

View File

@ -17,29 +17,14 @@
"mocha": "*",
"should": "*"
},
"readme": "\n# node-fresh\n\n HTTP response freshness testing\n\n## fresh(req, res)\n\n Check freshness of `req` and `res` headers.\n\n When the cache is \"fresh\" __true__ is returned,\n otherwise __false__ is returned to indicate that\n the cache is now stale.\n\n## Example:\n\n```js\nvar req = { 'if-none-match': 'tobi' };\nvar res = { 'etag': 'luna' };\nfresh(req, res);\n// => false\n\nvar req = { 'if-none-match': 'tobi' };\nvar res = { 'etag': 'tobi' };\nfresh(req, res);\n// => true\n```\n\n## Installation\n\n```\n$ npm install fresh\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"readmeFilename": "Readme.md",
"bugs": {
"url": "https://github.com/visionmedia/node-fresh/issues"
},
"homepage": "https://github.com/visionmedia/node-fresh#readme",
"_id": "fresh@0.2.0",
"dist": {
"shasum": "bfd9402cf3df12c4a4c310c79f99a3dde13d34a7",
"tarball": "https://registry.npmjs.org/fresh/-/fresh-0.2.0.tgz"
},
"_from": "fresh@0.2.0",
"_npmVersion": "1.3.4",
"_npmUser": {
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
},
"maintainers": [
{
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
}
],
"directories": {},
"_shasum": "bfd9402cf3df12c4a4c310c79f99a3dde13d34a7",
"_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.0.tgz",
"readme": "ERROR: No README data found!",
"homepage": "https://github.com/visionmedia/node-fresh#readme"
"_from": "fresh@0.2.0"
}

View File

@ -18,29 +18,14 @@
"type": "git",
"url": "git://github.com/visionmedia/node-methods.git"
},
"readme": "\n# Methods\n\n HTTP verbs that node core's parser supports.\n",
"readmeFilename": "Readme.md",
"bugs": {
"url": "https://github.com/visionmedia/node-methods/issues"
},
"homepage": "https://github.com/visionmedia/node-methods#readme",
"_id": "methods@0.1.0",
"dist": {
"shasum": "335d429eefd21b7bacf2e9c922a8d2bd14a30e4f",
"tarball": "https://registry.npmjs.org/methods/-/methods-0.1.0.tgz"
},
"_from": "methods@0.1.0",
"_npmVersion": "1.3.8",
"_npmUser": {
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
},
"maintainers": [
{
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
}
],
"directories": {},
"_shasum": "335d429eefd21b7bacf2e9c922a8d2bd14a30e4f",
"_resolved": "https://registry.npmjs.org/methods/-/methods-0.1.0.tgz",
"readme": "ERROR: No README data found!",
"homepage": "https://github.com/visionmedia/node-methods#readme"
"_from": "methods@0.1.0"
}

View File

@ -33,28 +33,11 @@
"devDependencies": {
"tap": "^2.3.0"
},
"gitHead": "a177da234df5638b363ddc15fa324619a38577c8",
"readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
"readmeFilename": "README.md",
"homepage": "https://github.com/isaacs/core-util-is#readme",
"_id": "core-util-is@1.0.2",
"_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
"_from": "core-util-is@>=1.0.0 <1.1.0",
"_npmVersion": "3.3.2",
"_nodeVersion": "4.0.0",
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
"dist": {
"shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
"tarball": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz"
},
"maintainers": [
{
"name": "isaacs",
"email": "i@izs.me"
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"readme": "ERROR: No README data found!"
"_from": "core-util-is@>=1.0.0 <1.1.0"
}

View File

@ -29,35 +29,14 @@
"inherits.js",
"inherits_browser.js"
],
"gitHead": "e05d0fb27c61a3ec687214f0476386b765364d5f",
"readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/inherits/issues"
},
"homepage": "https://github.com/isaacs/inherits#readme",
"_id": "inherits@2.0.3",
"_shasum": "633c2c83e3da42a502f52466022480f4208261de",
"_from": "inherits@>=2.0.1 <2.1.0",
"_npmVersion": "3.10.7",
"_nodeVersion": "6.5.0",
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
"dist": {
"shasum": "633c2c83e3da42a502f52466022480f4208261de",
"tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
},
"maintainers": [
{
"name": "isaacs",
"email": "i@izs.me"
}
],
"_npmOperationalInternal": {
"host": "packages-16-east.internal.npmjs.com",
"tmp": "tmp/inherits-2.0.3.tgz_1473295776489_0.08142363070510328"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"readme": "ERROR: No README data found!"
"_from": "inherits@>=2.0.1 <2.1.0"
}

View File

@ -26,28 +26,13 @@
"url": "http://juliangruber.com"
},
"license": "MIT",
"_id": "isarray@0.0.1",
"dist": {
"shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
"tarball": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"_from": "isarray@0.0.1",
"_npmVersion": "1.2.18",
"_npmUser": {
"name": "juliangruber",
"email": "julian@juliangruber.com"
},
"maintainers": [
{
"name": "juliangruber",
"email": "julian@juliangruber.com"
}
],
"directories": {},
"_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
"_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/juliangruber/isarray/issues"
},
"readme": "ERROR: No README data found!"
"_id": "isarray@0.0.1",
"_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
"_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"_from": "isarray@0.0.1"
}

View File

@ -22,33 +22,13 @@
"browserify"
],
"license": "MIT",
"gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0",
"readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/rvagg/string_decoder/issues"
},
"_id": "string_decoder@0.10.31",
"_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
"_from": "string_decoder@>=0.10.0 <0.11.0",
"_npmVersion": "1.4.23",
"_npmUser": {
"name": "rvagg",
"email": "rod@vagg.org"
},
"maintainers": [
{
"name": "substack",
"email": "mail@substack.net"
},
{
"name": "rvagg",
"email": "rod@vagg.org"
}
],
"dist": {
"shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
"tarball": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"readme": "ERROR: No README data found!"
"_from": "string_decoder@>=0.10.0 <0.11.0"
}

View File

@ -33,47 +33,14 @@
"url": "http://blog.izs.me/"
},
"license": "MIT",
"gitHead": "52550840cb1d6e8a98ef9a909a4bea360bc6f7da",
"readme": "# readable-stream\n\n***Node-core streams for userland***\n\n[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)\n[![NPM](https://nodei.co/npm-dl/readable-stream.png&months=6&height=3)](https://nodei.co/npm/readable-stream/)\n\nThis package is a mirror of the Streams2 and Streams3 implementations in Node-core.\n\nIf you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *\"stream\"* module in Node-core.\n\n**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12.\n\n**readable-stream** uses proper patch-level versioning so if you pin to `\"~1.0.0\"` youll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when youre ready to start using Streams3, pin to `\"~1.1.0\"`\n\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/readable-stream/issues"
},
"homepage": "https://github.com/isaacs/readable-stream#readme",
"_id": "readable-stream@1.1.14",
"_shasum": "7cf4c54ef648e3813084c636dd2079e166c081d9",
"_from": "readable-stream@>=1.1.9 <1.2.0",
"_npmVersion": "3.8.3",
"_nodeVersion": "5.10.1",
"_npmUser": {
"name": "cwmma",
"email": "calvin.metcalf@gmail.com"
},
"dist": {
"shasum": "7cf4c54ef648e3813084c636dd2079e166c081d9",
"tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz"
},
"maintainers": [
{
"name": "isaacs",
"email": "isaacs@npmjs.com"
},
{
"name": "tootallnate",
"email": "nathan@tootallnate.net"
},
{
"name": "rvagg",
"email": "rod@vagg.org"
},
{
"name": "cwmma",
"email": "calvin.metcalf@gmail.com"
}
],
"_npmOperationalInternal": {
"host": "packages-16-east.internal.npmjs.com",
"tmp": "tmp/readable-stream-1.1.14.tgz_1460563293219_0.5682175166439265"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"readme": "ERROR: No README data found!",
"homepage": "https://github.com/isaacs/readable-stream#readme"
"_from": "readable-stream@>=1.1.9 <1.2.0"
}

View File

@ -21,29 +21,14 @@
"dependencies": {
"readable-stream": "~1.1.8"
},
"readme": "# stream-counter\n\nKeep track of how many bytes have been written to a stream.\n\n## Usage\n\n```js\nvar StreamCounter = require('stream-counter');\nvar counter = new StreamCounter();\ncounter.on('progress', function() {\n console.log(\"progress\", counter.bytes);\n});\nfs.createReadStream('foo.txt').pipe(counter);\n```\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/superjoe30/node-stream-counter/issues"
},
"homepage": "https://github.com/superjoe30/node-stream-counter#readme",
"_id": "stream-counter@0.2.0",
"dist": {
"shasum": "ded266556319c8b0e222812b9cf3b26fa7d947de",
"tarball": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.2.0.tgz"
},
"_from": "stream-counter@>=0.2.0 <0.3.0",
"_npmVersion": "1.3.8",
"_npmUser": {
"name": "superjoe",
"email": "superjoe30@gmail.com"
},
"maintainers": [
{
"name": "superjoe",
"email": "superjoe30@gmail.com"
}
],
"directories": {},
"_shasum": "ded266556319c8b0e222812b9cf3b26fa7d947de",
"_resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.2.0.tgz",
"readme": "ERROR: No README data found!",
"homepage": "https://github.com/superjoe30/node-stream-counter#readme"
"_from": "stream-counter@>=0.2.0 <0.3.0"
}

File diff suppressed because one or more lines are too long

View File

@ -38,25 +38,15 @@
"node": "*"
},
"main": "lib/negotiator.js",
"_id": "negotiator@0.3.0",
"dependencies": {},
"dist": {
"shasum": "706d692efeddf574d57ea9fb1ab89a4fa7ee8f60",
"tarball": "https://registry.npmjs.org/negotiator/-/negotiator-0.3.0.tgz"
},
"maintainers": [
{
"name": "federomero",
"email": "federomero@gmail.com"
}
],
"directories": {},
"_shasum": "706d692efeddf574d57ea9fb1ab89a4fa7ee8f60",
"_resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.3.0.tgz",
"_from": "negotiator@0.3.0",
"readme": "# Negotiator\n\nAn HTTP content negotiator for node.js written in javascript.\n\n# Accept Negotiation\n\n Negotiator = require('negotiator')\n\n availableMediaTypes = ['text/html', 'text/plain', 'application/json']\n\n // The negotiator constructor receives a request object\n negotiator = new Negotiator(request)\n\n // Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8'\n\n negotiator.preferredMediaTypes()\n // -> ['text/html', 'image/jpeg', 'application/*']\n\n negotiator.preferredMediaTypes(availableMediaTypes)\n // -> ['text/html', 'application/json']\n\n negotiator.preferredMediaType(availableMediaTypes)\n // -> 'text/html'\n\nYou can check a working example at `examples/accept.js`.\n\n## Methods\n\n`preferredMediaTypes(availableMediaTypes)`:\n\nReturns an array of preferred media types ordered by priority from a list of available media types.\n\n`preferredMediaType(availableMediaType)`:\n\nReturns the top preferred media type from a list of available media types.\n\n# Accept-Language Negotiation\n\n Negotiator = require('negotiator')\n\n negotiator = new Negotiator(request)\n\n availableLanguages = 'en', 'es', 'fr'\n\n // Let's say Accept-Language header is 'en;q=0.8, es, pt'\n\n negotiator.preferredLanguages()\n // -> ['es', 'pt', 'en']\n\n negotiator.preferredLanguages(availableLanguages)\n // -> ['es', 'en']\n\n language = negotiator.preferredLanguage(availableLanguages)\n // -> 'es'\n\nYou can check a working example at `examples/language.js`.\n\n## Methods\n\n`preferredLanguages(availableLanguages)`:\n\nReturns an array of preferred languages ordered by priority from a list of available languages.\n\n`preferredLanguage(availableLanguages)`:\n\nReturns the top preferred language from a list of available languages.\n\n# Accept-Charset Negotiation\n\n Negotiator = require('negotiator')\n\n availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5']\n\n negotiator = new Negotiator(request)\n\n // Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2'\n\n negotiator.preferredCharsets()\n // -> ['utf-8', 'iso-8859-1', 'utf-7']\n\n negotiator.preferredCharsets(availableCharsets)\n // -> ['utf-8', 'iso-8859-1']\n\n negotiator.preferredCharset(availableCharsets)\n // -> 'utf-8'\n\nYou can check a working example at `examples/charset.js`.\n\n## Methods\n\n`preferredCharsets(availableCharsets)`:\n\nReturns an array of preferred charsets ordered by priority from a list of available charsets.\n\n`preferredCharset(availableCharsets)`:\n\nReturns the top preferred charset from a list of available charsets.\n\n# Accept-Encoding Negotiation\n\n Negotiator = require('negotiator').Negotiator\n\n availableEncodings = ['identity', 'gzip']\n\n negotiator = new Negotiator(request)\n\n // Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5'\n\n negotiator.preferredEncodings()\n // -> ['gzip', 'identity', 'compress']\n\n negotiator.preferredEncodings(availableEncodings)\n // -> ['gzip', 'identity']\n\n negotiator.preferredEncoding(availableEncodings)\n // -> 'gzip'\n\nYou can check a working example at `examples/encoding.js`.\n\n## Methods\n\n`preferredEncodings(availableEncodings)`:\n\nReturns an array of preferred encodings ordered by priority from a list of available encodings.\n\n`preferredEncoding(availableEncodings)`:\n\nReturns the top preferred encoding from a list of available encodings.\n\n# License\n\nMIT\n",
"readmeFilename": "readme.md",
"bugs": {
"url": "https://github.com/federomero/negotiator/issues"
},
"readme": "ERROR: No README data found!",
"homepage": "https://github.com/federomero/negotiator#readme"
"homepage": "https://github.com/federomero/negotiator#readme",
"dependencies": {},
"_id": "negotiator@0.3.0",
"_shasum": "706d692efeddf574d57ea9fb1ab89a4fa7ee8f60",
"_resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.3.0.tgz",
"_from": "negotiator@0.3.0"
}

View File

@ -13,20 +13,10 @@
"should": "*"
},
"main": "index",
"readme": "\n# pause\n\n Pause streams...\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"readmeFilename": "Readme.md",
"_id": "pause@0.0.1",
"dist": {
"shasum": "1d408b3fdb76923b9543d96fb4c9dfd535d9cb5d",
"tarball": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz"
},
"maintainers": [
{
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
}
],
"directories": {},
"_shasum": "1d408b3fdb76923b9543d96fb4c9dfd535d9cb5d",
"_resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz",
"_from": "pause@0.0.1",
"readme": "ERROR: No README data found!"
"_from": "pause@0.0.1"
}

View File

@ -33,26 +33,11 @@
"engines": {
"node": ">= 0.8.0"
},
"homepage": "https://github.com/stream-utils/raw-body",
"readme": "# Raw Body [![Build Status](https://travis-ci.org/stream-utils/raw-body.png)](https://travis-ci.org/stream-utils/raw-body)\n\nGets the entire buffer of a stream either as a `Buffer` or a string.\nValidates the stream's length against an expected length and maximum limit.\nIdeal for parsing request bodies.\n\n## API\n\n```js\nvar getRawBody = require('raw-body')\n\napp.use(function (req, res, next) {\n getRawBody(req, {\n length: req.headers['content-length'],\n limit: '1mb',\n encoding: 'utf8'\n }, function (err, string) {\n if (err)\n return next(err)\n\n req.text = string\n next()\n })\n})\n```\n\nor in a Koa generator:\n\n```js\napp.use(function* (next) {\n var string = yield getRawBody(this.req, {\n length: this.length,\n limit: '1mb',\n encoding: 'utf8'\n })\n})\n```\n\n### getRawBody(stream, [options], [callback])\n\nReturns a thunk for yielding with generators.\n\nOptions:\n\n- `length` - The length length of the stream.\n If the contents of the stream do not add up to this length,\n an `400` error code is returned.\n- `limit` - The byte limit of the body.\n If the body ends up being larger than this limit,\n a `413` error code is returned.\n- `encoding` - The requested encoding.\n By default, a `Buffer` instance will be returned.\n Most likely, you want `utf8`.\n You can use any type of encoding supported by [StringDecoder](http://nodejs.org/api/string_decoder.html).\n You can also pass `true` which sets it to the default `utf8`\n\n`callback(err, res)`:\n\n- `err` - the following attributes will be defined if applicable:\n\n - `limit` - the limit in bytes\n - `length` and `expected` - the expected length of the stream\n - `received` - the received bytes\n - `status` and `statusCode` - the corresponding status code for the error\n - `type` - either `entity.too.large`, `request.size.invalid`, or `stream.encoding.set`\n\n- `res` - the result, either as a `String` if an encoding was set or a `Buffer` otherwise.\n\nIf an error occurs, the stream will be paused,\nand you are responsible for correctly disposing the stream.\nFor HTTP requests, no handling is required if you send a response.\nFor streams that use file descriptors, you should `stream.destroy()` or `stream.close()` to prevent leaks.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Jonathan Ong me@jongleberry.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n",
"readmeFilename": "README.md",
"homepage": "https://github.com/stream-utils/raw-body#readme",
"_id": "raw-body@1.1.2",
"dist": {
"shasum": "c74b3004dea5defd1696171106ac740ec31d62be",
"tarball": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.2.tgz"
},
"_from": "raw-body@1.1.2",
"_npmVersion": "1.3.14",
"_npmUser": {
"name": "jongleberry",
"email": "jonathanrichardong@gmail.com"
},
"maintainers": [
{
"name": "jongleberry",
"email": "jonathanrichardong@gmail.com"
}
],
"directories": {},
"_shasum": "c74b3004dea5defd1696171106ac740ec31d62be",
"_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.2.tgz",
"readme": "ERROR: No README data found!"
"_from": "raw-body@1.1.2"
}

View File

@ -8,23 +8,7 @@
"dependencies": {},
"readme": "ERROR: No README data found!",
"_id": "uid2@0.0.3",
"dist": {
"shasum": "483126e11774df2f71b8b639dcd799c376162b82",
"tarball": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz"
},
"_from": "uid2@0.0.3",
"_npmVersion": "1.2.21",
"_npmUser": {
"name": "coreh",
"email": "thecoreh@gmail.com"
},
"maintainers": [
{
"name": "coreh",
"email": "thecoreh@gmail.com"
}
],
"directories": {},
"_shasum": "483126e11774df2f71b8b639dcd799c376162b82",
"_resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz"
"_resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz",
"_from": "uid2@0.0.3"
}

32
node_modules/connect/package.json generated vendored
View File

@ -54,38 +54,14 @@
"scripts": {
"test": "make"
},
"readme": "# Connect [![build status](https://secure.travis-ci.org/senchalabs/connect.png)](http://travis-ci.org/senchalabs/connect)\n\n Connect is an extensible HTTP server framework for [node](http://nodejs.org), providing high performance \"plugins\" known as _middleware_.\n\n Connect is bundled with over _20_ commonly used middleware, including\n a logger, session support, cookie parser, and [more](http://senchalabs.github.com/connect). Be sure to view the 2.x [documentation](http://senchalabs.github.com/connect/).\n\n```js\nvar connect = require('connect')\n , http = require('http');\n\nvar app = connect()\n .use(connect.favicon())\n .use(connect.logger('dev'))\n .use(connect.static('public'))\n .use(connect.directory('public'))\n .use(connect.cookieParser())\n .use(connect.session({ secret: 'my secret here' }))\n .use(function(req, res){\n res.end('Hello from Connect!\\n');\n });\n\nhttp.createServer(app).listen(3000);\n```\n\n## Middleware\n\n - [basicAuth](http://www.senchalabs.org/connect/basicAuth.html)\n - [bodyParser](http://www.senchalabs.org/connect/bodyParser.html)\n - [compress](http://www.senchalabs.org/connect/compress.html)\n - [cookieParser](http://www.senchalabs.org/connect/cookieParser.html)\n - [cookieSession](http://www.senchalabs.org/connect/cookieSession.html)\n - [csrf](http://www.senchalabs.org/connect/csrf.html)\n - [directory](http://www.senchalabs.org/connect/directory.html)\n - [errorHandler](http://www.senchalabs.org/connect/errorHandler.html)\n - [favicon](http://www.senchalabs.org/connect/favicon.html)\n - [json](http://www.senchalabs.org/connect/json.html)\n - [limit](http://www.senchalabs.org/connect/limit.html)\n - [logger](http://www.senchalabs.org/connect/logger.html)\n - [methodOverride](http://www.senchalabs.org/connect/methodOverride.html)\n - [multipart](http://www.senchalabs.org/connect/multipart.html)\n - [urlencoded](http://www.senchalabs.org/connect/urlencoded.html)\n - [query](http://www.senchalabs.org/connect/query.html)\n - [responseTime](http://www.senchalabs.org/connect/responseTime.html)\n - [session](http://www.senchalabs.org/connect/session.html)\n - [static](http://www.senchalabs.org/connect/static.html)\n - [staticCache](http://www.senchalabs.org/connect/staticCache.html)\n - [subdomains](http://www.senchalabs.org/connect/subdomains.html)\n - [vhost](http://www.senchalabs.org/connect/vhost.html)\n\n## Running Tests\n\nfirst:\n\n $ npm install -d\n\nthen:\n\n $ make test\n\n## Contributors\n\n https://github.com/senchalabs/connect/graphs/contributors\n\n## Node Compatibility\n\n Connect `< 1.x` is compatible with node 0.2.x\n\n\n Connect `1.x` is compatible with node 0.4.x\n\n\n Connect `2.x` is compatible with node 0.6.x\n\n\n Connect (_master_) is compatible with node 0.8.x\n\n## CLA\n\n [http://sencha.com/cla](http://sencha.com/cla)\n\n## License\n\nView the [LICENSE](https://github.com/senchalabs/connect/blob/master/LICENSE) file. The [Silk](http://www.famfamfam.com/lab/icons/silk/) icons used by the `directory` middleware created by/copyright of [FAMFAMFAM](http://www.famfamfam.com/).\n",
"readmeFilename": "Readme.md",
"bugs": {
"url": "https://github.com/senchalabs/connect/issues"
},
"homepage": "https://github.com/senchalabs/connect",
"homepage": "https://github.com/senchalabs/connect#readme",
"_id": "connect@2.12.0",
"dist": {
"shasum": "31d8fa0dcacdf1908d822bd2923be8a2d2a7ed9a",
"tarball": "https://registry.npmjs.org/connect/-/connect-2.12.0.tgz"
},
"_from": "connect@>=2.12.0 <2.13.0",
"_npmVersion": "1.3.14",
"_npmUser": {
"name": "jongleberry",
"email": "jonathanrichardong@gmail.com"
},
"maintainers": [
{
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
},
{
"name": "creationix",
"email": "tim@creationix.com"
},
{
"name": "jongleberry",
"email": "jonathanrichardong@gmail.com"
}
],
"deprecated": "connect 2.x series is deprecated",
"directories": {},
"_shasum": "31d8fa0dcacdf1908d822bd2923be8a2d2a7ed9a",
"_resolved": "https://registry.npmjs.org/connect/-/connect-2.12.0.tgz",
"readme": "ERROR: No README data found!"
"_from": "connect@>=2.12.0 <2.13.0"
}

23
node_modules/debug/package.json generated vendored
View File

@ -35,29 +35,14 @@
"debug/debug.js": "debug.js"
}
},
"readme": "# debug\n\n tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n \nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n , http = require('http')\n , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n debug(req.method + ' ' + req.url);\n res.end('hello\\n');\n}).listen(3000, function(){\n debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)\n\n ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)\n\n## Millisecond diff\n\n When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)\n\n When stderr is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n _(NOTE: Debug now uses stderr instead of stdout, so the correct shell command for this example is actually `DEBUG=* node example/worker 2> out &`)_\n \n ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)\n \n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\". \n\n## Wildcards\n\n The \"*\" character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n You can also exclude specific debuggers by prefixing them with a \"-\" character. For example, `DEBUG=* -connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. \n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n a('doing some work');\n}, 1200);\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
"readmeFilename": "Readme.md",
"bugs": {
"url": "https://github.com/visionmedia/debug/issues"
},
"homepage": "https://github.com/visionmedia/debug",
"homepage": "https://github.com/visionmedia/debug#readme",
"_id": "debug@0.7.4",
"dist": {
"shasum": "06e1ea8082c2cb14e39806e22e2f6f757f92af39",
"tarball": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz"
},
"_from": "debug@>=0.7.4 <0.8.0",
"_npmVersion": "1.3.13",
"_npmUser": {
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
},
"maintainers": [
{
"name": "tjholowaychuk",
"email": "tj@vision-media.ca"
}
],
"directories": {},
"_shasum": "06e1ea8082c2cb14e39806e22e2f6f757f92af39",
"_resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz",
"readme": "ERROR: No README data found!"
"_from": "debug@>=0.7.4 <0.8.0"
}

24
node_modules/ejs/package.json generated vendored

File diff suppressed because one or more lines are too long

View File

@ -19,29 +19,14 @@
"scripts": {
"test": "make test"
},
"readme": "# Emitter [![Build Status](https://travis-ci.org/component/emitter.png)](https://travis-ci.org/component/emitter)\n\n Event emitter component.\n\n## Installation\n\n```\n$ component install component/emitter\n```\n\n## API\n\n### Emitter(obj)\n\n The `Emitter` may also be used as a mixin. For example\n a \"plain\" object may become an emitter, or you may\n extend an existing prototype.\n\n As an `Emitter` instance:\n\n```js\nvar Emitter = require('emitter');\nvar emitter = new Emitter;\nemitter.emit('something');\n```\n\n As a mixin:\n\n```js\nvar Emitter = require('emitter');\nvar user = { name: 'tobi' };\nEmitter(user);\n\nuser.emit('im a user');\n```\n\n As a prototype mixin:\n\n```js\nvar Emitter = require('emitter');\nEmitter(User.prototype);\n```\n\n### Emitter#on(event, fn)\n\n Register an `event` handler `fn`.\n\n### Emitter#once(event, fn)\n\n Register a single-shot `event` handler `fn`,\n removed immediately after it is invoked the\n first time.\n\n### Emitter#off(event, fn)\n\n * Pass `event` and `fn` to remove a listener.\n * Pass `event` to remove all listeners on that event.\n * Pass nothing to remove all listeners on all events.\n\n### Emitter#emit(event, ...)\n\n Emit an `event` with variable option args.\n\n### Emitter#listeners(event)\n\n Return an array of callbacks, or an empty array.\n\n### Emitter#hasListeners(event)\n\n Check if this emitter has `event` handlers.\n\n## License\n\nMIT\n",
"readmeFilename": "Readme.md",
"bugs": {
"url": "https://github.com/component/emitter/issues"
},
"homepage": "https://github.com/component/emitter",
"homepage": "https://github.com/component/emitter#readme",
"_id": "component-emitter@1.1.2",
"dist": {
"shasum": "296594f2753daa63996d2af08d15a95116c9aec3",
"tarball": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz"
},
"_from": "component-emitter@1.1.2",
"_npmVersion": "1.3.24",
"_npmUser": {
"name": "tootallnate",
"email": "nathan@tootallnate.net"
},
"maintainers": [
{
"name": "tootallnate",
"email": "nathan@tootallnate.net"
}
],
"directories": {},
"_shasum": "296594f2753daa63996d2af08d15a95116c9aec3",
"_resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz",
"readme": "ERROR: No README data found!"
"_from": "component-emitter@1.1.2"
}

View File

@ -16,29 +16,14 @@
"type": "git",
"url": "git+https://github.com/component/inherit.git"
},
"readme": "# inherit\n\n Prototype inheritance utility.\n\n## Installation\n\n```\n$ component install component/inherit\n```\n\n## Example\n\n```js\nvar inherit = require('inherit');\n\nfunction Human() {}\nfunction Woman() {}\n\ninherit(Woman, Human);\n```\n\n## License\n\n MIT\n",
"readmeFilename": "Readme.md",
"bugs": {
"url": "https://github.com/component/inherit/issues"
},
"homepage": "https://github.com/component/inherit",
"homepage": "https://github.com/component/inherit#readme",
"_id": "component-inherit@0.0.3",
"dist": {
"shasum": "645fc4adf58b72b649d5cae65135619db26ff143",
"tarball": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz"
},
"_from": "component-inherit@0.0.3",
"_npmVersion": "1.3.24",
"_npmUser": {
"name": "coreh",
"email": "thecoreh@gmail.com"
},
"maintainers": [
{
"name": "coreh",
"email": "thecoreh@gmail.com"
}
],
"directories": {},
"_shasum": "645fc4adf58b72b649d5cae65135619db26ff143",
"_resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz",
"readme": "ERROR: No README data found!"
"_from": "component-inherit@0.0.3"
}

View File

@ -17,32 +17,14 @@
"ms/index.js": "index.js"
}
},
"gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909",
"readme": "# ms.js: miliseconds conversion utility\n\n```js\nms('2 days') // 172800000\nms('1d') // 86400000\nms('10h') // 36000000\nms('2.5 hrs') // 9000000\nms('2h') // 7200000\nms('1m') // 60000\nms('5s') // 5000\nms('100') // 100\n```\n\n```js\nms(60000) // \"1m\"\nms(2 * 60000) // \"2m\"\nms(ms('10 hours')) // \"10h\"\n```\n\n```js\nms(60000, { long: true }) // \"1 minute\"\nms(2 * 60000, { long: true }) // \"2 minutes\"\nms(ms('10 hours'), { long: true }) // \"10 hours\"\n```\n\n- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download).\n- If a number is supplied to `ms`, a string with a unit is returned.\n- If a string that contains the number is supplied, it returns it as\na number (e.g: it returns `100` for `'100'`).\n- If you pass a string with a number and a valid unit, the number of\nequivalent ms is returned.\n\n## License\n\nMIT\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/guille/ms.js/issues"
},
"homepage": "https://github.com/guille/ms.js",
"homepage": "https://github.com/guille/ms.js#readme",
"_id": "ms@0.7.1",
"scripts": {},
"_shasum": "9cd13c03adbff25b65effde7ce864ee952017098",
"_from": "ms@0.7.1",
"_npmVersion": "2.7.5",
"_nodeVersion": "0.12.2",
"_npmUser": {
"name": "rauchg",
"email": "rauchg@gmail.com"
},
"maintainers": [
{
"name": "rauchg",
"email": "rauchg@gmail.com"
}
],
"dist": {
"shasum": "9cd13c03adbff25b65effde7ce864ee952017098",
"tarball": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
"readme": "ERROR: No README data found!"
"_from": "ms@0.7.1"
}

Some files were not shown because too many files have changed in this diff Show More