Initial commit - Event Planner application
This commit is contained in:
1
node_modules/@lukeed/csprng/browser/index.d.ts
generated
vendored
Normal file
1
node_modules/@lukeed/csprng/browser/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export function random<T=Uint8Array>(len: number): T;
|
||||
5
node_modules/@lukeed/csprng/browser/index.js
generated
vendored
Normal file
5
node_modules/@lukeed/csprng/browser/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
function random(len) {
|
||||
return crypto.getRandomValues(new Uint8Array(len));
|
||||
}
|
||||
|
||||
exports.random = random;
|
||||
1
node_modules/@lukeed/csprng/browser/index.min.js
generated
vendored
Normal file
1
node_modules/@lukeed/csprng/browser/index.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e["@lukeed/csprng"]={})}(this,(function(e){e.random=function(e){return crypto.getRandomValues(new Uint8Array(e))}}));
|
||||
3
node_modules/@lukeed/csprng/browser/index.mjs
generated
vendored
Normal file
3
node_modules/@lukeed/csprng/browser/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export function random(len) {
|
||||
return crypto.getRandomValues(new Uint8Array(len));
|
||||
}
|
||||
1
node_modules/@lukeed/csprng/index.d.ts
generated
vendored
Normal file
1
node_modules/@lukeed/csprng/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export function random<T = Buffer | Uint8Array>(len: number): T;
|
||||
9
node_modules/@lukeed/csprng/license
generated
vendored
Normal file
9
node_modules/@lukeed/csprng/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.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.
|
||||
1
node_modules/@lukeed/csprng/node/index.d.ts
generated
vendored
Normal file
1
node_modules/@lukeed/csprng/node/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export function random<T=Buffer>(len: number): T;
|
||||
7
node_modules/@lukeed/csprng/node/index.js
generated
vendored
Normal file
7
node_modules/@lukeed/csprng/node/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
const { randomBytes } = require('crypto');
|
||||
|
||||
function random(len) {
|
||||
return randomBytes(len);
|
||||
}
|
||||
|
||||
exports.random = random;
|
||||
1
node_modules/@lukeed/csprng/node/index.min.js
generated
vendored
Normal file
1
node_modules/@lukeed/csprng/node/index.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e["@lukeed/csprng"]={})}(this,(function(e){const{randomBytes:n}=require("crypto");e.random=function(e){return n(e)}}));
|
||||
5
node_modules/@lukeed/csprng/node/index.mjs
generated
vendored
Normal file
5
node_modules/@lukeed/csprng/node/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { randomBytes } from 'crypto';
|
||||
|
||||
export function random(len) {
|
||||
return randomBytes(len);
|
||||
}
|
||||
73
node_modules/@lukeed/csprng/package.json
generated
vendored
Normal file
73
node_modules/@lukeed/csprng/package.json
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"version": "1.1.0",
|
||||
"name": "@lukeed/csprng",
|
||||
"repository": "lukeed/csprng",
|
||||
"description": "An alias package for `crypto.randomBytes` in Node.js and/or browsers",
|
||||
"unpkg": "browser/index.min.js",
|
||||
"browser": "browser/index.mjs",
|
||||
"module": "node/index.mjs",
|
||||
"main": "node/index.js",
|
||||
"types": "index.d.ts",
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "Luke Edwards",
|
||||
"email": "luke.edwards05@gmail.com",
|
||||
"url": "https://lukeed.com"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"browser": {
|
||||
"types": "./browser/index.d.ts",
|
||||
"import": "./browser/index.mjs",
|
||||
"require": "./browser/index.js"
|
||||
},
|
||||
"types": "./node/index.d.ts",
|
||||
"import": "./node/index.mjs",
|
||||
"require": "./node/index.js"
|
||||
},
|
||||
"./node": {
|
||||
"types": "./node/index.d.ts",
|
||||
"import": "./node/index.mjs",
|
||||
"require": "./node/index.js"
|
||||
},
|
||||
"./browser": {
|
||||
"types": "./browser/index.d.ts",
|
||||
"import": "./browser/index.mjs",
|
||||
"require": "./browser/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "bundt",
|
||||
"test": "uvu -r esm test"
|
||||
},
|
||||
"files": [
|
||||
"*.d.ts",
|
||||
"browser",
|
||||
"node"
|
||||
],
|
||||
"modes": {
|
||||
"browser": "src/browser.js",
|
||||
"node": "src/node.js"
|
||||
},
|
||||
"keywords": [
|
||||
"crypto",
|
||||
"browser",
|
||||
"isomorphic",
|
||||
"getRandomValues",
|
||||
"randomFill",
|
||||
"random",
|
||||
"csprng"
|
||||
],
|
||||
"devDependencies": {
|
||||
"bundt": "1.1.1",
|
||||
"esm": "3.2.25",
|
||||
"uvu": "0.5.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
76
node_modules/@lukeed/csprng/readme.md
generated
vendored
Normal file
76
node_modules/@lukeed/csprng/readme.md
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
# @lukeed/csprng  [](https://codecov.io/gh/lukeed/csprng)
|
||||
|
||||
> A tiny (~90B) isomorphic wrapper for `crypto.randomBytes` in Node.js and browsers.
|
||||
|
||||
***Why?***
|
||||
|
||||
This package allows you/dependents to import a cryptographically secure generator (CSPRNG) _without_ worrying about (aka, checking the runtime environment for) the different `crypto` implementations. Instead, by extracting a `random` function into a third-party/external package, one can rely on bundlers and/or module resolution to load the correct implementation for the desired environment.
|
||||
|
||||
In other words, one can include the browser-specific implementation when bundling for the browser, completely ignoring the Node.js code – or vice versa.
|
||||
|
||||
By default, this module is set up to work with Rollup, webpack, and Node's native ESM _and_ CommonJS path resolutions.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save @lukeed/csprng
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
***General Usage***
|
||||
|
||||
```js
|
||||
// Rely on bundlers/environment detection
|
||||
import { random } from '@lukeed/csprng';
|
||||
|
||||
const array = random(12);
|
||||
// browser => Uint8Array(12) [...]
|
||||
// Node.js => <Buffer ...>
|
||||
```
|
||||
|
||||
***Specific Environment***
|
||||
|
||||
```js
|
||||
// Choose the "browser" implementation explicitly.
|
||||
//=> ! NOTE ! Will break in Node.js environments!
|
||||
import { random } from '@lukeed/csprng/browser';
|
||||
|
||||
const array = random(1024);
|
||||
//=> Uint8Array(1024) [...]
|
||||
|
||||
// ---
|
||||
|
||||
// Choose the "node" implementation explicitly.
|
||||
//=> ! NOTE ! Will break in browser environments!
|
||||
import { random } from '@lukeed/csprng/node';
|
||||
|
||||
const array = random(1024);
|
||||
//=> <Buffer ...>
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### random(length)
|
||||
Returns: `Buffer` or `Uint8Array`
|
||||
|
||||
Returns a typed array of given `length`.
|
||||
|
||||
|
||||
#### length
|
||||
Type: `Number`
|
||||
|
||||
The desired length of your output TypedArray.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [uid](https://github.com/lukeed/uid) - A tiny (134B) and fast utility to randomize unique IDs of fixed length
|
||||
- [@lukeed/uuid](https://github.com/lukeed/uuid) - A tiny (230B), fast, and cryptographically secure UUID (V4) generator for Node and the browser
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Luke Edwards](https://lukeed.com)
|
||||
Reference in New Issue
Block a user