Skip to content

Commit 8a96abd

Browse files
committed
Packaging.
1 parent 8534ba8 commit 8a96abd

File tree

9 files changed

+75
-9
lines changed

9 files changed

+75
-9
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
bower_components

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js:
3+
- "0.10"
4+
- "0.11"
5+
script: "npm test"

blake2s.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "blake2s-js",
3+
"version": "1.0.0",
4+
"homepage": "https://github.com/dchest/blake2s-js",
5+
"authors": [
6+
"Dmitry Chestnykh <[email protected]>"
7+
],
8+
"description": "Pure JavaScript implementation of BLAKE2s cryptographic hash function",
9+
"main": "blake2s.js",
10+
"moduleType": [
11+
"globals",
12+
"node"
13+
],
14+
"keywords": [
15+
"blake2",
16+
"blake2s",
17+
"blake",
18+
"hash",
19+
"crypto",
20+
"cryptographic"
21+
],
22+
"license": "Public domain",
23+
"ignore": [
24+
"**/.*",
25+
"node_modules",
26+
"bower_components",
27+
"test",
28+
"tests",
29+
"demo"
30+
]
31+
}

build.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.
File renamed without changes.

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "blake2s-js",
3+
"version": "1.0.0",
4+
"description": "Pure JavaScript implementation of BLAKE2s cryptographic hash function.",
5+
"main": "blake2s.js",
6+
"scripts": {
7+
"build": "uglifyjs blake2s.js -c -m -o blake2s.min.js",
8+
"test": "node test/test.js"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/dchest/blake2s-js"
13+
},
14+
"keywords": [
15+
"blake2",
16+
"blake2s",
17+
"blake",
18+
"hash",
19+
"crypto",
20+
"cryptographic"
21+
],
22+
"author": "Dmitry Chestnykh",
23+
"license": "Public domain",
24+
"bugs": {
25+
"url": "https://github.com/dchest/blake2s-js/issues"
26+
},
27+
"devDependencies": {
28+
"uglify-js": "2.x.x"
29+
},
30+
"homepage": "https://github.com/dchest/blake2s-js"
31+
}

test.html renamed to test/test.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
Open console to view results.
88
</body>
9-
<script src="blake2s.js"></script>
9+
<script src="../blake2s.js"></script>
1010
<script src="test.js"></script>
1111
</html>

test.js renamed to test/test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Run: node test.js
2-
var BLAKE2s = typeof require !== 'undefined' ? require('./blake2s.js') : window.BLAKE2s;
2+
var BLAKE2s = typeof require !== 'undefined' ? require('../blake2s.js') : window.BLAKE2s;
33

44
var golden = [
55
"69217a3079908094e11121d042354a7c1f55b6482ca1a51e1b250dfd1ed0eef9",
@@ -575,7 +575,7 @@ for (i = 2; i < 128; i++) {
575575
var cand = h1.hexDigest();
576576

577577
if (good != cand) {
578-
console.log('fail #', i, '\n', 'have', cand, '\n', 'need', good);
578+
console.error('fail #', i, '\n', 'have', cand, '\n', 'need', good);
579579
fails++;
580580
} else {
581581
passes++;
@@ -585,7 +585,8 @@ for (i = 2; i < 128; i++) {
585585
if (fails == 0) {
586586
console.log('PASS');
587587
} else {
588-
console.log('FAIL', fails, 'of', fails+passes);
588+
console.error('FAIL', fails, 'of', fails+passes);
589+
if (typeof process !== 'undefined') process.exit(1);
589590
}
590591

591592
// Benchmark.

0 commit comments

Comments
 (0)