feat:node-modules
This commit is contained in:
7
node_modules/md5/.travis.yml
generated
vendored
Normal file
7
node_modules/md5/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.12
|
||||
- 4
|
||||
- 5
|
||||
- 6
|
||||
- 7
|
||||
27
node_modules/md5/LICENSE
generated
vendored
Normal file
27
node_modules/md5/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright © 2011-2012, Paul Vorbach.
|
||||
Copyright © 2009, Jeff Mott.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* Neither the name Crypto-JS nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
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 HOLDER 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.
|
||||
111
node_modules/md5/README.md
generated
vendored
Normal file
111
node_modules/md5/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
48
node_modules/md5/demo/index.html
generated
vendored
Normal file
48
node_modules/md5/demo/index.html
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<input type="file" id="input">
|
||||
<output id="output"></output>
|
||||
<style>
|
||||
output::before {
|
||||
content: "output:";
|
||||
}
|
||||
output {
|
||||
display: block;
|
||||
padding: 1em;
|
||||
margin: 1em;
|
||||
outline: 1px solid gray;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
<script src="../dist/md5.min.js"></script>
|
||||
<script>
|
||||
|
||||
|
||||
function readAsArrayBuffer(file){
|
||||
return new Promise(function(resolve) {
|
||||
var reader = new FileReader();
|
||||
reader.readAsArrayBuffer(file)
|
||||
reader.onload = function(e) {
|
||||
resolve(e.target.result)
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
input.onchange = function(e) {
|
||||
var file = input.files[0];
|
||||
readAsArrayBuffer(file)
|
||||
.then(buffer => {
|
||||
console.log(buffer);
|
||||
var now = performance.now();
|
||||
var hash = MD5(buffer);
|
||||
var after = performance.now() - now;
|
||||
output.innerHTML = `
|
||||
file: ${file.name}
|
||||
size: ${file.size} bytes
|
||||
type: ${file.type}
|
||||
md5: ${hash}
|
||||
duration: ${after.toFixed(2)} ms
|
||||
`;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
7
node_modules/md5/dist/md5.min.js
generated
vendored
Normal file
7
node_modules/md5/dist/md5.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
160
node_modules/md5/md5.js
generated
vendored
Normal file
160
node_modules/md5/md5.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
38
node_modules/md5/package.json
generated
vendored
Normal file
38
node_modules/md5/package.json
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "md5",
|
||||
"description": "js function for hashing messages with MD5",
|
||||
"version": "2.3.0",
|
||||
"author": "Paul Vorbach <paul@vorba.ch> (http://paul.vorba.ch)",
|
||||
"contributors": [
|
||||
"salba"
|
||||
],
|
||||
"tags": [
|
||||
"md5",
|
||||
"hash",
|
||||
"encryption",
|
||||
"message digest"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/pvorb/node-md5.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pvorb/node-md5/issues"
|
||||
},
|
||||
"main": "md5.js",
|
||||
"scripts": {
|
||||
"test": "mocha",
|
||||
"webpack": "webpack -p"
|
||||
},
|
||||
"dependencies": {
|
||||
"charenc": "0.0.2",
|
||||
"crypt": "0.0.2",
|
||||
"is-buffer": "~1.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "~2.3.4",
|
||||
"webpack": "~2.4.1"
|
||||
},
|
||||
"optionalDependencies": {},
|
||||
"license": "BSD-3-Clause"
|
||||
}
|
||||
75
node_modules/md5/test.js
generated
vendored
Normal file
75
node_modules/md5/test.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
var md5 = require('./md5.js');
|
||||
var assert = require('assert');
|
||||
|
||||
describe('md5', function () {
|
||||
|
||||
it('should throw an error for an undefined value', function() {
|
||||
assert.throws(function() {
|
||||
md5(undefined);
|
||||
});
|
||||
});
|
||||
|
||||
it('should allow the hashing of the string `undefined`', function() {
|
||||
assert.equal('5e543256c480ac577d30f76f9120eb74', md5('undefined'));
|
||||
});
|
||||
|
||||
it('should throw an error for `null`', function() {
|
||||
assert.throws(function() {
|
||||
md5(null);
|
||||
});
|
||||
});
|
||||
|
||||
it('should return the expected MD5 hash for "message"', function() {
|
||||
assert.equal('78e731027d8fd50ed642340b7c9a63b3', md5('message'));
|
||||
});
|
||||
|
||||
it('should not return the same hash for random numbers twice', function() {
|
||||
var msg1 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime();
|
||||
var msg2 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime();
|
||||
|
||||
if (msg1 !== msg2) {
|
||||
assert.notEqual(md5(msg1), md5(msg2));
|
||||
} else {
|
||||
assert.equal(md5(msg1), md5(msg1));
|
||||
}
|
||||
});
|
||||
|
||||
it('should support Node.js Buffers', function() {
|
||||
var buffer = new Buffer('message áßäöü', 'utf8');
|
||||
|
||||
assert.equal(md5(buffer), md5('message áßäöü'));
|
||||
})
|
||||
|
||||
it('should be able to use a binary encoded string', function() {
|
||||
var hash1 = md5('abc', { asString: true });
|
||||
var hash2 = md5(hash1 + 'a', { asString: true, encoding : 'binary' });
|
||||
var hash3 = md5(hash1 + 'a', { encoding : 'binary' });
|
||||
assert.equal(hash3, '131f0ac52813044f5110e4aec638c169');
|
||||
});
|
||||
|
||||
it('should support Uint8Array', function() {
|
||||
// Polyfills
|
||||
if (!Array.from) {
|
||||
Array.from = function(src, fn) {
|
||||
var result = new Array(src.length);
|
||||
for (var i = 0; i < src.length; ++i)
|
||||
result[i] = fn(src[i]);
|
||||
return result;
|
||||
};
|
||||
}
|
||||
if (!Uint8Array.from) {
|
||||
Uint8Array.from = function(src) {
|
||||
var result = new Uint8Array(src.length);
|
||||
for (var i = 0; i < src.length; ++i)
|
||||
result[i] = src[i];
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
var message = 'foobarbaz';
|
||||
var u8arr = Uint8Array.from(
|
||||
Array.from(message, function(c) { return c.charCodeAt(0); }));
|
||||
var u8aHash = md5(u8arr);
|
||||
assert.equal(u8aHash, md5(message));
|
||||
});
|
||||
});
|
||||
13
node_modules/md5/webpack.config.js
generated
vendored
Normal file
13
node_modules/md5/webpack.config.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
const {resolve} = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: [
|
||||
'./md5.js'
|
||||
],
|
||||
output: {
|
||||
path: resolve('./dist'),
|
||||
filename: 'md5.min.js',
|
||||
libraryTarget: "var",
|
||||
library: "MD5"
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user