https://github.com/letiantian/random-password
Generate random password.
https://github.com/letiantian/random-password
Last synced: 3 months ago
JSON representation
Generate random password.
- Host: GitHub
- URL: https://github.com/letiantian/random-password
- Owner: letiantian
- Created: 2016-04-06T14:12:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-08T09:12:08.000Z (over 9 years ago)
- Last Synced: 2025-10-03T13:52:09.875Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# random-password
Generate random password.
## Install
```
$ npm install random-password --save
```
## Example
The length of password should be gived:
```js
var generator=require('random-password');
generator(4); // 'WA6n'
generator(10); // '49Pm!N&i9M'
```
The table to generate password could be specified:
```js
generator(4, '1234567890'); // '5575'
generator(10, '1234567890'); // '1926972366'
```
If length is `Nan`, `Infinity` or `-Infinity`, the default length `8` will be used:
```js
generator(NaN); //'0vpgip!G'
```
## License
MIT