Update app and tooling
This commit is contained in:
parent
3046531bdd
commit
e620ec7349
4950 changed files with 2975120 additions and 10 deletions
2
node_modules/uid-promise/lib/chars.js
generated
vendored
Normal file
2
node_modules/uid-promise/lib/chars.js
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
// Charset from github.com/coreh/uid2
|
||||
module.exports = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
||||
23
node_modules/uid-promise/lib/index.js
generated
vendored
Normal file
23
node_modules/uid-promise/lib/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Packages
|
||||
const crypto = require('crypto')
|
||||
|
||||
// Utilities
|
||||
const UIDCHARS = require('./chars')
|
||||
|
||||
module.exports = len => new Promise((resolve, reject) => {
|
||||
if (typeof len !== 'number') {
|
||||
reject(new TypeError('You must supply a length integer to `uid-promise`.'))
|
||||
return
|
||||
}
|
||||
|
||||
crypto.randomBytes(len, (err, buf) => {
|
||||
if (err) {
|
||||
return reject(err)
|
||||
}
|
||||
const str = []
|
||||
for (let i = 0; i < buf.length; i++) {
|
||||
str.push(UIDCHARS[buf[i] % UIDCHARS.length])
|
||||
}
|
||||
resolve(str.join(''))
|
||||
})
|
||||
})
|
||||
21
node_modules/uid-promise/license.md
generated
vendored
Normal file
21
node_modules/uid-promise/license.md
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2017 Zeit, Inc.
|
||||
|
||||
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.
|
||||
23
node_modules/uid-promise/package.json
generated
vendored
Normal file
23
node_modules/uid-promise/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"name": "uid-promise",
|
||||
"version": "1.0.0",
|
||||
"description": "generates a cryptographically strong random uid",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"repository": "zeit/uid-promise",
|
||||
"license": "MIT",
|
||||
"xo": {
|
||||
"esnext": true,
|
||||
"space": true,
|
||||
"semicolon": false
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "0.19.1",
|
||||
"xo": "0.17.0"
|
||||
}
|
||||
}
|
||||
41
node_modules/uid-promise/readme.md
generated
vendored
Normal file
41
node_modules/uid-promise/readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# uid-promise
|
||||
|
||||
[](https://travis-ci.org/zeit/uid-promise)
|
||||
[](https://github.com/sindresorhus/xo)
|
||||
|
||||
Creates a cryptographically secure UID with a 62 character range that can be safely used in URLs.
|
||||
|
||||
## Usage
|
||||
|
||||
Firstly, install the package from [npm](https://www.npmjs.com):
|
||||
|
||||
```js
|
||||
npm install --save uid-promise
|
||||
```
|
||||
|
||||
Then load it:
|
||||
|
||||
```js
|
||||
const uid = require('uid-promise')
|
||||
```
|
||||
|
||||
Finally, call it:
|
||||
|
||||
```js
|
||||
await uid(20)
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
**`uid(Number len) => Promise`**
|
||||
|
||||
- Return a `Promise` that resolves with a string of random characters
|
||||
of length `len`
|
||||
- `len` must always be provided, else the promise is rejected
|
||||
- Under the hood, `crypto.randomBytes` is used
|
||||
- Character set: `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`
|
||||
|
||||
## Authors
|
||||
|
||||
- Guillermo Rauch ([@rauchg](https://twitter.com/rauchg)) - [▲ZEIT](https://zeit.co)
|
||||
- Leo Lamprecht ([@notquiteleo](https://twitter.com/notquiteleo)) - [▲ZEIT](https://zeit.co)
|
||||
Loading…
Add table
Add a link
Reference in a new issue