js-sha3 0.5.3 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.covignore +1 -1
- package/.npmignore +3 -2
- package/CHANGELOG.md +74 -50
- package/README.md +10 -2
- package/bower.json +9 -9
- package/build/sha3.min.js +8 -21
- package/index.d.ts +92 -0
- package/package.json +39 -34
- package/src/sha3.js +475 -470
- package/tests/node-test.js +28 -1
- package/tests/test.js +316 -313
package/tests/node-test.js
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
expect = require('expect.js');
|
|
2
|
+
|
|
3
|
+
// Node.js env
|
|
4
|
+
var sha3 = require('../src/sha3.js');
|
|
5
|
+
keccak_512 = sha3.keccak_512;
|
|
6
|
+
keccak_384 = sha3.keccak_384;
|
|
7
|
+
keccak_256 = sha3.keccak_256;
|
|
8
|
+
keccak_224 = sha3.keccak_224;
|
|
9
|
+
sha3_512 = sha3.sha3_512;
|
|
10
|
+
sha3_384 = sha3.sha3_384;
|
|
11
|
+
sha3_256 = sha3.sha3_256;
|
|
12
|
+
sha3_224 = sha3.sha3_224;
|
|
13
|
+
shake_128 = sha3.shake_128;
|
|
14
|
+
shake_256 = sha3.shake_256;
|
|
15
|
+
require('./test.js');
|
|
16
|
+
require('./test-shake.js');
|
|
17
|
+
|
|
18
|
+
delete require.cache[require.resolve('../src/sha3.js')];
|
|
19
|
+
delete require.cache[require.resolve('./test.js')];
|
|
20
|
+
delete require.cache[require.resolve('./test-shake.js')];
|
|
21
|
+
|
|
22
|
+
// Webpack browser env
|
|
23
|
+
JS_SHA3_NO_NODE_JS = true;
|
|
24
|
+
window = global;
|
|
25
|
+
expect = require('expect.js');
|
|
2
26
|
var sha3 = require('../src/sha3.js');
|
|
3
27
|
keccak_512 = sha3.keccak_512;
|
|
4
28
|
keccak_384 = sha3.keccak_384;
|
|
@@ -27,7 +51,10 @@ keccak_224 = null;
|
|
|
27
51
|
shake_128 = null;
|
|
28
52
|
shake_256 = null;
|
|
29
53
|
|
|
30
|
-
|
|
54
|
+
// browser env
|
|
55
|
+
JS_SHA3_NO_NODE_JS = true;
|
|
56
|
+
JS_SHA3_NO_COMMON_JS = true;
|
|
57
|
+
window = global;
|
|
31
58
|
require('../src/sha3.js');
|
|
32
59
|
require('./test.js');
|
|
33
60
|
require('./test-shake.js');
|