1.1.0 • Published 4 months ago

@hosterai/passwords v1.1.0

Weekly downloads
-
License
Apache-2.0
Repository
gitlab
Last release
4 months 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

4 months ago

1.0.20

5 months ago

1.0.18

5 months ago

1.0.17

5 months ago

1.0.12

5 months ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago