commit
b249e417a7
@ -0,0 +1 @@
|
||||
/tests/
|
@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
covreporter
|
@ -0,0 +1,13 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.11"
|
||||
- "0.10"
|
||||
- "0.8"
|
||||
before_install:
|
||||
- npm install mocha -g
|
||||
- npm install coveralls -g
|
||||
- npm install mocha-lcov-reporter -g
|
||||
script: npm run-script coveralls
|
||||
branches:
|
||||
only:
|
||||
- master
|
@ -0,0 +1,3 @@
|
||||
# v0.1.0 / 2015-02-23
|
||||
|
||||
* Initial release
|
@ -0,0 +1,20 @@
|
||||
Copyright 2015 emn178@gmail.com
|
||||
|
||||
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.
|
@ -0,0 +1,131 @@
|
||||
# js-sha3
|
||||
[](https://travis-ci.org/emn178/js-sha3)
|
||||
[](https://coveralls.io/r/emn178/js-sha3?branch=master)
|
||||
[](https://nodei.co/npm/js-sha3/)
|
||||
A simple SHA-3 / Keccak hash function for JavaScript supports UTF-8 encoding.
|
||||
|
||||
## Download
|
||||
[Compress](https://raw.github.com/emn178/js-sha3/master/build/sha3.min.js)
|
||||
[Uncompress](https://raw.github.com/emn178/js-sha3/master/src/sha3.js)
|
||||
|
||||
## Installation
|
||||
You can also install js-sha3 by using Bower.
|
||||
|
||||
bower install js-sha3
|
||||
|
||||
For node.js, you can use this command to install:
|
||||
|
||||
npm install js-sha3
|
||||
|
||||
## Usage
|
||||
You could use like this:
|
||||
```JavaScript
|
||||
sha3_512('Message to hash');
|
||||
sha3_384('Message to hash');
|
||||
sha3_256('Message to hash');
|
||||
sha3_224('Message to hash');
|
||||
```
|
||||
If you use node.js, you should require the module first:
|
||||
```JavaScript
|
||||
sha3_512 = require('js-sha3').sha3_512;
|
||||
sha3_384 = require('js-sha3').sha3_384;
|
||||
sha3_256 = require('js-sha3').sha3_256;
|
||||
sha3_224 = require('js-sha3').sha3_224;
|
||||
```
|
||||
|
||||
## Example
|
||||
Code
|
||||
```JavaScript
|
||||
sha3_512('');
|
||||
sha3_512('The quick brown fox jumps over the lazy dog');
|
||||
sha3_512('The quick brown fox jumps over the lazy dog.');
|
||||
sha3_384('');
|
||||
sha3_384('The quick brown fox jumps over the lazy dog');
|
||||
sha3_384('The quick brown fox jumps over the lazy dog.');
|
||||
sha3_256('');
|
||||
sha3_256('The quick brown fox jumps over the lazy dog');
|
||||
sha3_256('The quick brown fox jumps over the lazy dog.');
|
||||
sha3_224('');
|
||||
sha3_224('The quick brown fox jumps over the lazy dog');
|
||||
sha3_224('The quick brown fox jumps over the lazy dog.');
|
||||
```
|
||||
Output
|
||||
|
||||
0eab42de4c3ceb9235fc91acffe746b29c29a8c366b7c60e4e67c466f36a4304c00fa9caf9d87976ba469bcbe06713b435f091ef2769fb160cdab33d3670680e
|
||||
d135bb84d0439dbac432247ee573a23ea7d3c9deb2a968eb31d47c4fb45f1ef4422d6c531b5b9bd6f449ebcc449ea94d0a8f05f62130fda612da53c79659f609
|
||||
ab7192d2b11f51c7dd744e7b3441febf397ca07bf812cceae122ca4ded6387889064f8db9230f173f6d1ab6e24b6e50f065b039f799f5592360a6558eb52d760
|
||||
2c23146a63a29acf99e73b88f8c24eaa7dc60aa771780ccc006afbfa8fe2479b2dd2b21362337441ac12b515911957ff
|
||||
283990fa9d5fb731d786c5bbee94ea4db4910f18c62c03d173fc0a5e494422e8a0b3da7574dae7fa0baf005e504063b3
|
||||
9ad8e17325408eddb6edee6147f13856ad819bb7532668b605a24a2d958f88bd5c169e56dc4b2f89ffd325f6006d820b
|
||||
c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470
|
||||
4d741b6f1eb29cb2a9b9911c82f56fa8d73b04959d3d9d222895df6c0b28aa15
|
||||
578951e24efd62a3d63a86f7cd19aaa53c898fe287d2552133220370240b572d
|
||||
f71837502ba8e10837bdd8d365adb85591895602fc552b48b7390abd
|
||||
310aee6b30c47350576ac2873fa89fd190cdc488442f3ef654cf23fe
|
||||
c59d4eaeac728671c635ff645014e2afa935bebffdb5fbd207ffdeab
|
||||
|
||||
It also supports UTF-8 encoding:
|
||||
|
||||
Code
|
||||
```JavaScript
|
||||
sha3_512('中文');
|
||||
sha3_384('中文');
|
||||
sha3_256('中文');
|
||||
sha3_224('中文');
|
||||
```
|
||||
Output
|
||||
|
||||
2f6a1bd50562230229af34b0ccf46b8754b89d23ae2c5bf7840b4acfcef86f87395edc0a00b2bfef53bafebe3b79de2e3e01cbd8169ddbb08bde888dcc893524
|
||||
743f64bb7544c6ed923be4741b738dde18b7cee384a3a09c4e01acaaac9f19222cdee137702bd3aa05dc198373d87d6c
|
||||
70a2b6579047f0a977fcb5e9120a4e07067bea9abb6916fbc2d13ffb9a4e4eee
|
||||
f71837502ba8e10837bdd8d365adb85591895602fc552b48b7390abd
|
||||
|
||||
## Extensions
|
||||
### jQuery
|
||||
If you prefer jQuery style, you can add following code to add a jQuery extension.
|
||||
|
||||
Code
|
||||
```JavaScript
|
||||
jQuery.sha3_512 = sha3_512;
|
||||
jQuery.sha3_384 = sha3_384;
|
||||
jQuery.sha3_256 = sha3_256;
|
||||
jQuery.sha3_224 = sha3_224;
|
||||
```
|
||||
And then you could use like this:
|
||||
```JavaScript
|
||||
$.sha3_512('message');
|
||||
$.sha3_384('message');
|
||||
$.sha3_256('message');
|
||||
$.sha3_224('message');
|
||||
```
|
||||
### Prototype
|
||||
If you prefer prototype style, you can add following code to add a prototype extension.
|
||||
|
||||
Code
|
||||
```JavaScript
|
||||
String.prototype.sha3_512 = function() {
|
||||
return sha3_512(this);
|
||||
};
|
||||
String.prototype.sha3_384 = function() {
|
||||
return sha3_384(this);
|
||||
};
|
||||
String.prototype.sha3_256 = function() {
|
||||
return sha3_256(this);
|
||||
};
|
||||
String.prototype.sha3_224 = function() {
|
||||
return sha3_224(this);
|
||||
};
|
||||
```
|
||||
And then you could use like this:
|
||||
```JavaScript
|
||||
'message'.sha3_512();
|
||||
'message'.sha3_384();
|
||||
'message'.sha3_256();
|
||||
'message'.sha3_224();
|
||||
```
|
||||
## License
|
||||
The project is released under the [MIT license](http://www.opensource.org/licenses/MIT).
|
||||
|
||||
## Contact
|
||||
The project's website is located at https://github.com/emn178/js-sha3
|
||||
Author: emn178@gmail.com
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "js-sha3",
|
||||
"version": "0.1.0",
|
||||
"main": ["build/sha3.min.js"],
|
||||
"ignore": [
|
||||
"samples",
|
||||
"tests"
|
||||
]
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
(function(m,E){var w="undefined"!=typeof module;w&&(m=global);var p="0123456789abcdef".split(""),F=[1,256,65536,16777216],r=[0,8,16,24],G=[0,1,62,28,27,36,44,6,55,20,3,10,43,25,39,41,45,15,21,8,18,2,61,56,14],A=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,
|
||||
32896,2147483648,2147483649,0,2147516424,2147483648],c=[],b=[],l=[],q=[],B=function(b){return n(b,224)},C=function(b){return n(b,256)},D=function(b){return n(b,384)},n=function(m,n){n===E&&(n=512);var x,d,u=!1,t=0,w=0,y=m.length,e,g,f,k,a,h,v=(1600-2*n)/32,z=4*v;for(a=0;50>a;++a)b[a]=0;x=0;do{c[0]=x;for(a=1;a<v+1;++a)c[a]=0;for(a=w;t<y&&a<z;++t)d=m.charCodeAt(t),128>d?c[a>>2]|=d<<r[a++&3]:(2048>d?c[a>>2]|=(192|d>>6)<<r[a++&3]:(55296>d||57344<=d?c[a>>2]|=(224|d>>12)<<r[a++&3]:(d=65536+((d&1023)<<10|
|
||||
m.charCodeAt(++t)&1023),c[a>>2]|=(240|d>>18)<<r[a++&3],c[a>>2]|=(128|d>>12&63)<<r[a++&3]),c[a>>2]|=(128|d>>6&63)<<r[a++&3]),c[a>>2]|=(128|d&63)<<r[a++&3]);w=a-z;t==y&&(c[a>>2]|=F[a&3],++t);x=c[v];t>y&&a<z&&(c[v-1]|=2147483648,u=!0);for(a=0;a<v;++a)b[a]^=c[a];for(d=0;24>d;d++){for(e=0;5>e;e++)f=2*e,q[f]=b[f]^b[f+10]^b[f+20]^b[f+30]^b[f+40],q[f+1]=b[f+1]^b[f+11]^b[f+21]^b[f+31]^b[f+41];for(e=0;5>e;e++)for(f=2*e,a=(e+4)%5*2,h=(e+1)%5*2,k=q[a]^(q[h]<<1|q[h+1]>>>31),h=q[a+1]^(q[h+1]<<1|q[h]>>>31),g=0;5>
|
||||
g;g++)a=f+10*g,b[a]^=k,b[a+1]^=h;for(e=0;5>e;e++)for(f=2*e,g=0;5>g;g++)a=f+10*g,h=2*g+(f+3*g)%5*10,k=G[e+5*g],0===k?(l[h]=b[a],l[h+1]=b[a+1]):32>k?(l[h]=b[a]<<k|b[a+1]>>>32-k,l[h+1]=b[a+1]<<k|b[a]>>>32-k):(l[h]=b[a+1]<<k-32|b[a]>>>64-k,l[h+1]=b[a]<<k-32|b[a+1]>>>64-k);for(e=0;5>e;e++)for(f=2*e,g=0;5>g;g++)a=f+10*g,h=2*((e+1)%5+5*g),k=2*((e+2)%5+5*g),b[a]=l[a]^~l[h]&l[k],b[a+1]=l[a+1]^~l[h+1]&l[k+1];b[0]^=A[2*d];b[1]^=A[2*d+1]}}while(!u);u="";a=0;for(d=n/32;a<d;++a)u+=p[b[a]>>4&15]+p[b[a]&15]+p[b[a]>>
|
||||
12&15]+p[b[a]>>8&15]+p[b[a]>>20&15]+p[b[a]>>16&15]+p[b[a]>>28&15]+p[b[a]>>24&15];return u};!m.JS_SHA3_TEST&&w?module.exports={sha3_512:n,sha3_384:D,sha3_256:C,sha3_224:B}:m&&(m.sha3_512=n,m.sha3_384=D,m.sha3_256=C,m.sha3_224=B)})(this);
|
@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "js-sha3",
|
||||
"version": "0.1.0",
|
||||
"description": "A simple SHA-3 / Keccak hash function for JavaScript supports UTF-8 encoding.",
|
||||
"main": "src/sha3.js",
|
||||
"devDependencies": {
|
||||
"expect.js": "~0.3.1",
|
||||
"jscoverage": "~0.5.9"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha tests/node-test.js -r jscoverage",
|
||||
"coveralls": "mocha tests/node-test.js -R mocha-lcov-reporter -r jscoverage | coveralls"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/emn178/js-sha3.git"
|
||||
},
|
||||
"keywords": [
|
||||
"sha3",
|
||||
"keccak",
|
||||
"hash",
|
||||
"encryption",
|
||||
"cryptography",
|
||||
"HMAC"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": "emn178 <emn178@gmail.com>",
|
||||
"homepage": "https://github.com/emn178/js-sha3",
|
||||
"bugs": {
|
||||
"url": "https://github.com/emn178/js-sha3/issues"
|
||||
}
|
||||
}
|
@ -0,0 +1,172 @@
|
||||
/*
|
||||
* js-sha3 v0.1.0
|
||||
* https://github.com/emn178/js-sha3
|
||||
*
|
||||
* Copyright 2015, emn178@gmail.com
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
;(function(root, undefined) {
|
||||
'use strict';
|
||||
|
||||
var NODE_JS = typeof(module) != 'undefined';
|
||||
if(NODE_JS) {
|
||||
root = global;
|
||||
}
|
||||
var HEX_CHARS = '0123456789abcdef'.split('');
|
||||
var EXTRA = [1, 256, 65536, 16777216];
|
||||
var SHIFT = [0, 8, 16, 24];
|
||||
var R = [0, 1, 62, 28, 27, 36, 44, 6, 55, 20, 3, 10, 43, 25, 39, 41, 45, 15, 21, 8, 18, 2, 61, 56, 14];
|
||||
var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,
|
||||
0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,
|
||||
2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,
|
||||
2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,
|
||||
2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];
|
||||
|
||||
var blocks = [], s = [], b = [], c = [];
|
||||
|
||||
var sha3_224 = function(message) {
|
||||
return sha3(message, 224);
|
||||
};
|
||||
|
||||
var sha3_256 = function(message) {
|
||||
return sha3(message, 256);
|
||||
};
|
||||
|
||||
var sha3_384 = function(message) {
|
||||
return sha3(message, 384);
|
||||
};
|
||||
|
||||
var sha3 = function(message, bits) {
|
||||
if(bits === undefined) {
|
||||
bits = 512;
|
||||
}
|
||||
|
||||
var block, code, end = false, index = 0, start = 0, length = message.length,
|
||||
n, x, y, x2, r, i, j, k, h, l;
|
||||
var blockCount = (1600 - bits * 2) / 32;
|
||||
var byteCount = blockCount * 4;
|
||||
|
||||
for(i = 0;i < 50;++i) {
|
||||
s[i] = 0;
|
||||
}
|
||||
|
||||
block = 0;
|
||||
do {
|
||||
blocks[0] = block;
|
||||
for(i = 1;i < blockCount + 1;++i) {
|
||||
blocks[i] = 0;
|
||||
}
|
||||
for (i = start;index < length && i < byteCount; ++index) {
|
||||
code = message.charCodeAt(index);
|
||||
if (code < 0x80) {
|
||||
blocks[i >> 2] |= code << SHIFT[i++ & 3];
|
||||
} else if (code < 0x800) {
|
||||
blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
|
||||
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
||||
} else if (code < 0xd800 || code >= 0xe000) {
|
||||
blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
|
||||
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
||||
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
||||
} else {
|
||||
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
|
||||
blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
|
||||
blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
|
||||
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
||||
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
||||
}
|
||||
}
|
||||
start = i - byteCount;
|
||||
if(index == length) {
|
||||
blocks[i >> 2] |= EXTRA[i & 3];
|
||||
++index;
|
||||
}
|
||||
block = blocks[blockCount];
|
||||
if(index > length && i < byteCount) {
|
||||
blocks[blockCount - 1] |= 0x80000000;
|
||||
end = true;
|
||||
}
|
||||
|
||||
for(i = 0;i < blockCount;++i) {
|
||||
s[i] ^= blocks[i];
|
||||
}
|
||||
|
||||
for(n = 0; n < 24; n++) {
|
||||
for (x = 0; x < 5; x++) {
|
||||
x2 = x * 2;
|
||||
c[x2] = s[x2] ^ s[x2 + 10] ^ s[x2 + 20] ^ s[x2 + 30] ^ s[x2 + 40];
|
||||
c[x2 + 1] = s[x2 + 1] ^ s[x2 + 11] ^ s[x2 + 21] ^ s[x2 + 31] ^ s[x2 + 41];
|
||||
}
|
||||
|
||||
for (x = 0; x < 5; x++) {
|
||||
x2 = x * 2;
|
||||
i = ((x + 4) % 5) * 2;
|
||||
j = ((x + 1) % 5) * 2;
|
||||
h = c[i] ^ ((c[j] << 1) | (c[j + 1] >>> 31));
|
||||
l = c[i + 1] ^ ((c[j + 1] << 1) | (c[j] >>> 31));
|
||||
for (y = 0; y < 5; y++) {
|
||||
i = x2 + y * 10;
|
||||
s[i] ^= h;
|
||||
s[i + 1] ^= l;
|
||||
}
|
||||
}
|
||||
|
||||
for (x = 0; x < 5; x++) {
|
||||
x2 = x * 2;
|
||||
for (y = 0; y < 5; y++) {
|
||||
i = x2 + y * 10;
|
||||
j = y * 2 + ((x2 + 3 * y) % 5) * 10;
|
||||
r = R[x + y * 5];
|
||||
if(r === 0) {
|
||||
b[j] = s[i];
|
||||
b[j + 1] = s[i + 1];
|
||||
} else if (r < 32) {
|
||||
b[j] = (s[i] << r) | (s[i + 1] >>> (32 - r));
|
||||
b[j + 1] = (s[i + 1] << r) | (s[i] >>> (32 - r));
|
||||
} else {
|
||||
b[j] = (s[i + 1] << (r - 32)) | (s[i] >>> (64 - r));
|
||||
b[j + 1] = (s[i] << (r - 32)) | (s[i + 1] >>> (64 - r));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (x = 0; x < 5; x++) {
|
||||
x2 = x * 2;
|
||||
for (y = 0; y < 5; y++) {
|
||||
i = x2 + y * 10;
|
||||
j = (((x + 1) % 5) + 5 * y) * 2;
|
||||
k = (((x + 2) % 5) + 5 * y) * 2;
|
||||
s[i] = b[i] ^ (~b[j] & b[k]);
|
||||
s[i + 1] = b[i + 1] ^ (~b[j + 1] & b[k + 1]);
|
||||
}
|
||||
}
|
||||
s[0] ^= RC[n * 2];
|
||||
s[1] ^= RC[n * 2 + 1];
|
||||
}
|
||||
} while(!end);
|
||||
|
||||
var hex = '';
|
||||
for(i = 0, n = bits / 32;i < n;++i) {
|
||||
hex += HEX_CHARS[(s[i] >> 4) & 0x0F] + HEX_CHARS[s[i] & 0x0F] +
|
||||
HEX_CHARS[(s[i] >> 12) & 0x0F] + HEX_CHARS[(s[i] >> 8) & 0x0F] +
|
||||
HEX_CHARS[(s[i] >> 20) & 0x0F] + HEX_CHARS[(s[i] >> 16) & 0x0F] +
|
||||
HEX_CHARS[(s[i] >> 28) & 0x0F] + HEX_CHARS[(s[i] >> 24) & 0x0F];
|
||||
}
|
||||
return hex;
|
||||
};
|
||||
|
||||
if(!root.JS_SHA3_TEST && NODE_JS) {
|
||||
module.exports = {
|
||||
sha3_512: sha3,
|
||||
sha3_384: sha3_384,
|
||||
sha3_256: sha3_256,
|
||||
sha3_224: sha3_224
|
||||
};
|
||||
} else if(root) {
|
||||
root.sha3_512 = sha3;
|
||||
root.sha3_384 = sha3_384;
|
||||
root.sha3_256 = sha3_256;
|
||||
root.sha3_224 = sha3_224;
|
||||
}
|
||||
}(this));
|
@ -0,0 +1,22 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>SHA3</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/2.1.0/mocha.min.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/2.1.0/mocha.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/expect.js/0.2.0/expect.min.js"></script>
|
||||
<script src="../src/sha3.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="mocha"></div>
|
||||
<script>
|
||||
mocha.setup('bdd');
|
||||
</script>
|
||||
<script src="test.js"></script>
|
||||
<script>
|
||||
mocha.checkLeaks();
|
||||
mocha.run();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,17 @@
|
||||
sha3_512 = require('../src/sha3.js').sha3_512;
|
||||
sha3_384 = require('../src/sha3.js').sha3_384;
|
||||
sha3_256 = require('../src/sha3.js').sha3_256;
|
||||
sha3_224 = require('../src/sha3.js').sha3_224;
|
||||
expect = require('expect.js');
|
||||
require('./test.js');
|
||||
|
||||
delete require.cache[require.resolve('../src/sha3.js')]
|
||||
delete require.cache[require.resolve('./test.js')]
|
||||
sha3_512 = null;
|
||||
sha3_384 = null;
|
||||
sha3_256 = null;
|
||||
sha3_224 = null;
|
||||
|
||||
JS_SHA3_TEST = true;
|
||||
require('../src/sha3.js');
|
||||
require('./test.js');
|
Loading…
Reference in New Issue