1.1.0 • Published 2 years ago

@hosterai/passwords v1.1.0

Weekly downloads
-
License
Apache-2.0
Repository
gitlab
Last release
2 years ago

Password Generator

This project is a simple password generator written in TypeScript.

Usage

Import the Password class from main.js:

import { Password } from './main';

Create a new instance of the Password class:

let password = new Password();

You can then generate a password using the generate method:

let pwd = password.generate(10);

This will generate a 10-character password.

Customization

You can customize the length of the different character types in the password:

let pwd = password
    .lowercaseLength(2)
    .uppercaseLength(2)
    .symbolsLength(2)
    .numbersLength(2)
    .generate(10);

his will generate a 10-character password with 2 lowercase letters, 2 uppercase letters, 2 symbols, and 2 numbers.

Testing

Tests are located in the main.spec.ts file. They can be run using your test runner of choice.

The tests cover the following scenarios:

The generate method returns a password of the correct length. The generate method returns a password containing only lowercase letters when only the lowercaseLength is set. The generate method returns a password containing only uppercase letters when only the uppercaseLength is set. The generate method returns a password containing only numbers when only the numbersLength is set.

1.1.0

2 years ago

1.0.20

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.12

2 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago