Travis build: 1297 [cron]

This commit is contained in:
30secondsofcode
2018-01-17 20:11:19 +00:00
parent f176e041a2
commit e0e30a6108
13 changed files with 1575 additions and 1370 deletions

View File

@ -0,0 +1,9 @@
const hashBrowser = val =>
crypto.subtle.digest('SHA-256', new TextEncoder('utf-8').encode(val)).then(h => {
let hexes = [],
view = new DataView(h);
for (let i = 0; i < view.byteLength; i += 4)
hexes.push(('00000000' + view.getUint32(i).toString(16)).slice(-8));
return hexes.join('');
});
module.exports = hashBrowser

View File

@ -0,0 +1,13 @@
const test = require('tape');
const hashBrowser = require('./hashBrowser.js');
test('Testing hashBrowser', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof hashBrowser === 'function', 'hashBrowser is a Function');
//t.deepEqual(hashBrowser(args..), 'Expected');
//t.equal(hashBrowser(args..), 'Expected');
//t.false(hashBrowser(args..), 'Expected');
//t.throws(hashBrowser(args..), 'Expected');
t.end();
});

15
test/hashNode/hashNode.js Normal file
View File

@ -0,0 +1,15 @@
const crypto = require('crypto');
const hashNode = val =>
new Promise(resolve =>
setTimeout(
() =>
resolve(
crypto
.createHash('sha256')
.update(val)
.digest('hex')
),
0
)
);
module.exports = hashNode

View File

@ -0,0 +1,13 @@
const test = require('tape');
const hashNode = require('./hashNode.js');
test('Testing hashNode', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof hashNode === 'function', 'hashNode is a Function');
//t.deepEqual(hashNode(args..), 'Expected');
//t.equal(hashNode(args..), 'Expected');
//t.false(hashNode(args..), 'Expected');
//t.throws(hashNode(args..), 'Expected');
t.end();
});

2
test/is/is.js Normal file
View File

@ -0,0 +1,2 @@
const is = (type, val) => val instanceof type;
module.exports = is

13
test/is/is.test.js Normal file
View File

@ -0,0 +1,13 @@
const test = require('tape');
const is = require('./is.js');
test('Testing is', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof is === 'function', 'is is a Function');
//t.deepEqual(is(args..), 'Expected');
//t.equal(is(args..), 'Expected');
//t.false(is(args..), 'Expected');
//t.throws(is(args..), 'Expected');
t.end();
});

File diff suppressed because it is too large Load Diff