https://github.com/techassi/pwgen
Simple, fast and secure password generation on the web written in Typescript
https://github.com/techassi/pwgen
password-generation typescript
Last synced: 2 months ago
JSON representation
Simple, fast and secure password generation on the web written in Typescript
- Host: GitHub
- URL: https://github.com/techassi/pwgen
- Owner: Techassi
- Created: 2017-08-05T11:51:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-03-03T16:07:51.000Z (almost 5 years ago)
- Last Synced: 2025-03-05T02:20:07.396Z (11 months ago)
- Topics: password-generation, typescript
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pwgen
A simple and fast javascript-based password generator
## features
- choose length of password (min 6)
- include a personal string (e.g. your name, birth date, ...) [not recommended]
- copy to clipboard
- debug information
- add / remove ui elements with keywords
- 'readable' option (remove all special characters)
## planned features
- abstract certain characters (e.g. 1 -> ! or A -> 4)
## usage
### script
- Add the latest jQuery via Google Hosted Libraries to your project head
- Add the `pwgen.js` or (`pwgen.min.js`) file aswell
```html
```
Add this at the end of your file:
```html
$('.your-class').pwgen();
```
### css
- Add the `style.css` or `style.min.css` file to your project head
- fully responsive design (`.pwgen`'s size gets adjusted based on screen size). The responsive design can be toggled. See [here](https://github.com/Techassi/pwgen#responsive).
```html
```
## config
The script can be configured the way you like in the following fashion:
```html
$('.your-class').pwgen({
'foo': bar,
'dog': lazy
});
```
Supported keywords:
## style
### responsive
Toggles if the container uses responsive design.
TypeError results in `'responsive' = true`
```javascript
'responsive': true
supported values: true / false (boolean)
default: true
```
### length_field
Toggles if the length input field is displayed.
TypeError results in `'length_field' = false`
If the length input field isn't displayed (`'length_field' = false`) the script uses a length between `max_length` and `min_length`
```javascript
'length_field': true
supported values: true / false (boolean)
default: true
```
### include_field
Toggles if the inlude input field is displayed.
TypeError results in `'include_field' = false`
```javascript
'include_field': true
supported values: true / false (boolean)
default: true
```
### readable
Toggles if the 'readable' checkbox is displayed.
TypeError results in `'readable' = false`
```javascript
'readable': true
supported values: true / false (boolean)
default: false
```
### show_hint
Toggles if the hint box is displayed
TypeError results in `'show_hint' = true`
```javascript
'show_hint': true
supported values: true / false (boolean)
default: true
```
### show_copy
Toggles if 'copy to clipboard' is displayed
TypeError results in `'show_copy' = true`
```javascript
'show_copy': true
supported values: true / false (boolean)
default: true
```
### show_debug
Toggles if debug switch is displayed
TypeError results in `'show_debug' = false`
```javascript
'show_debug': true
supported values: true / false (boolean)
default: false
```
## behavior
### min_length
Set the minimum length of the password.
TypeError results in `'min_length' = 6`
```javascript
'min_length': 6
supported values: numeric
default: 6
```
### max_length
Set the maximum length of the password.
TypeError results in `'max_length' = 12`
```javascript
'max_length': 12
supported values: numeric
default: 12
```
### include
Set an include string to be included in every generated password.
TypeError results in `'include' = ''`
```javascript
'include': 'foo'
supported values: string
default: ''
```
### include_append
Where to append 'include' to user-entered include string.
TypeError results in `'include_append' = 'right'`
```javascript
'include_append': 'right'
supported values: 'right' / 'left'
default: 'right'
```
Example:
```javascript
user: foo
'include': bar
- 'include_append': 'left'
bar|foo
- 'include_append': 'right'
foo|bar
```
## complete example
```html
$('.your-class').pwgen({
'responsive': true,
'min_length': 8,
'max_length': 12,
'include': 'foo',
'include_append': 'right',
'length_field': false;
});
```
- container uses responsive design
- password has a minimum length of 8
- password has a maximum length of 12
- 'foo' gets included into every password [again not recommended]
- 'foo' gets appended on the right
- no length input field is displayed (results in random number between 8 [inclusive] and 12 [inclusive])