Template Upload

This commit is contained in:
SOUTHERNCO\x2mjbyrn
2017-05-17 13:45:25 -04:00
parent 415b9c25f3
commit 7efe7605b8
11476 changed files with 2170865 additions and 34 deletions

3
node_modules/base64id/.npmignore generated vendored Normal file
View File

@ -0,0 +1,3 @@
support
test
examples

18
node_modules/base64id/README.md generated vendored Normal file
View File

@ -0,0 +1,18 @@
base64id
========
Node.js module that generates a base64 id.
Uses crypto.randomBytes when available, falls back to unsafe methods for node.js <= 0.4.
To increase performance, random bytes are buffered to minimize the number of synchronous calls to crypto.randomBytes.
## Installation
$ npm install mongoose
## Usage
var base64id = require('base64id');
var id = base64id.generateId();

103
node_modules/base64id/lib/base64id.js generated vendored Normal file
View File

@ -0,0 +1,103 @@
/*!
* base64id v0.1.0
*/
/**
* Module dependencies
*/
var crypto = require('crypto');
/**
* Constructor
*/
var Base64Id = function() { };
/**
* Get random bytes
*
* Uses a buffer if available, falls back to crypto.randomBytes
*/
Base64Id.prototype.getRandomBytes = function(bytes) {
var BUFFER_SIZE = 4096
var self = this;
bytes = bytes || 12;
if (bytes > BUFFER_SIZE) {
return crypto.randomBytes(bytes);
}
var bytesInBuffer = parseInt(BUFFER_SIZE/bytes);
var threshold = parseInt(bytesInBuffer*0.85);
if (!threshold) {
return crypto.randomBytes(bytes);
}
if (this.bytesBufferIndex == null) {
this.bytesBufferIndex = -1;
}
if (this.bytesBufferIndex == bytesInBuffer) {
this.bytesBuffer = null;
this.bytesBufferIndex = -1;
}
// No buffered bytes available or index above threshold
if (this.bytesBufferIndex == -1 || this.bytesBufferIndex > threshold) {
if (!this.isGeneratingBytes) {
this.isGeneratingBytes = true;
crypto.randomBytes(BUFFER_SIZE, function(err, bytes) {
self.bytesBuffer = bytes;
self.bytesBufferIndex = 0;
self.isGeneratingBytes = false;
});
}
// Fall back to sync call when no buffered bytes are available
if (this.bytesBufferIndex == -1) {
return crypto.randomBytes(bytes);
}
}
var result = this.bytesBuffer.slice(bytes*this.bytesBufferIndex, bytes*(this.bytesBufferIndex+1));
this.bytesBufferIndex++;
return result;
}
/**
* Generates a base64 id
*
* (Original version from socket.io <http://socket.io>)
*/
Base64Id.prototype.generateId = function () {
var rand = new Buffer(15); // multiple of 3 for base64
if (!rand.writeInt32BE) {
return Math.abs(Math.random() * Math.random() * Date.now() | 0).toString()
+ Math.abs(Math.random() * Math.random() * Date.now() | 0).toString();
}
this.sequenceNumber = (this.sequenceNumber + 1) | 0;
rand.writeInt32BE(this.sequenceNumber, 11);
if (crypto.randomBytes) {
this.getRandomBytes(12).copy(rand);
} else {
// not secure for node 0.4
[0, 4, 8].forEach(function(i) {
rand.writeInt32BE(Math.random() * Math.pow(2, 32) | 0, i);
});
}
return rand.toString('base64').replace(/\//g, '_').replace(/\+/g, '-');
};
/**
* Export
*/
exports = module.exports = new Base64Id();

67
node_modules/base64id/package.json generated vendored Normal file
View File

@ -0,0 +1,67 @@
{
"_args": [
[
"base64id@0.1.0",
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\engine.io"
]
],
"_defaultsLoaded": true,
"_engineSupported": true,
"_from": "base64id@0.1.0",
"_id": "base64id@0.1.0",
"_inCache": true,
"_location": "/base64id",
"_nodeVersion": "v0.6.15",
"_npmUser": {
"email": "faeldt_kristian@cyberagent.co.jp",
"name": "faeldt_kristian"
},
"_npmVersion": "1.1.16",
"_phantomChildren": {},
"_requested": {
"name": "base64id",
"raw": "base64id@0.1.0",
"rawSpec": "0.1.0",
"scope": null,
"spec": "0.1.0",
"type": "version"
},
"_requiredBy": [
"/engine.io"
],
"_resolved": "https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz",
"_shasum": "02ce0fdeee0cef4f40080e1e73e834f0b1bfce3f",
"_shrinkwrap": null,
"_spec": "base64id@0.1.0",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\engine.io",
"author": {
"email": "faeldt_kristian@cyberagent.co.jp",
"name": "Kristian Faeldt"
},
"dependencies": {},
"description": "Generates a base64 id",
"devDependencies": {},
"directories": {},
"dist": {
"shasum": "02ce0fdeee0cef4f40080e1e73e834f0b1bfce3f",
"tarball": "https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz"
},
"engines": {
"node": ">= 0.4.0"
},
"installable": true,
"main": "./lib/base64id.js",
"maintainers": [
{
"name": "faeldt_kristian",
"email": "faeldt_kristian@cyberagent.co.jp"
}
],
"name": "base64id",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "git://github.com/faeldt/base64id.git"
},
"version": "0.1.0"
}