Skip to content

Latest commit

 

History

History
69 lines (43 loc) · 2.52 KB

readme.md

File metadata and controls

69 lines (43 loc) · 2.52 KB

FastPass.js

NPM Downloads

FastPass.js is a lightweight JavaScript library that allows you to generate strong and secure random passwords quickly and easily. Whether you need to create a new password for your online accounts or generate multiple passwords for your team, FastPass.js has you covered.

Installation

You can install FastPass.js via npm:

npm install fastpass.js

Alternatively, you can include the following script tag in your HTML file to load the library from jsDelivr's CDN:

<script src="https://cdn.jsdelivr.net/npm/fastpass.js/fastpass.min.js"></script>

Usage

To generate a random password with FastPass.js, simply call the fastpass.generate() method with your desired options:

var defaultPassword = fastpass.generate();
var customPassword = fastpass.generate({
    length: 16,
    charsets: ['lowercase', 'uppercase', 'numbers', 'symbols'],
    excludeSimilar: true,
    excludeAmbiguous: true
});

Options

  • length: (optional) The length of the generated password. Default is 12.
  • charsets: (optional) An array of character set names to include. Default is ['lowercase', 'uppercase', 'numbers'].
  • excludeSimilar: (optional) Exclude characters that can be easily confused, such as i, l, 1, O, 0, etc. Default is false.
  • excludeAmbiguous: (optional) Exclude characters that are ambiguous in certain fonts, such as {}, (), [], /, ~, <, >, ;, :, ., ', ", ?. Default is false.
  • customCharset: (optional) A custom string representing a character set to use. This allows you to define exactly which characters to include in the generated password.

Example with Custom Charset

You can also generate a password using a custom character set:

var customCharsetPassword = fastpass.generate({
    customCharset: 'abcXYZ123!@#'
});

Contributions

Contributions are welcome and greatly appreciated! If you find a bug, have a feature request, or want to contribute code, please open an issue or submit a pull request on Github.

License

FastPass.js is licensed under the MIT License. Feel free to use, modify, and distribute the library as you see fit.