PHPackages                             tbetool/php-password-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tbetool/php-password-generator

ActiveLibrary

tbetool/php-password-generator
==============================

PHP random and secure password generator class

v1.4(8y ago)017.9k↑30%PHPPHP &gt;=5.3.0

Since Oct 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/TBETool/password-generator)[ Packagist](https://packagist.org/packages/tbetool/php-password-generator)[ Docs](http://thebornengineer.com)[ RSS](/packages/tbetool-php-password-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

password-generator
==================

[](#password-generator)

php class for random and secure password generation

Installation
============

[](#installation)

```
composer require tbetool/php-password-generator

```

Usage
=====

[](#usage)

### Create object

[](#create-object)

```
use TBETool\PasswordGenerator;

$passwordGenerator = new PasswordGenerator();

```

You can optionally pass following parameters to constructor

```
use TBETool\PasswordGenerator;

$passwordGenerator = new PasswordGenerator($length, $count, $characters);

```

#### Parameter Details

[](#parameter-details)

```
$length (int) : Length of the password to generate, Default: 8
$count (int) : No of passwords to generate, Default: 1
$characters (string): Characters to use while password generation

```

#### Supported Characters

[](#supported-characters)

1. lower\_case
2. upper\_case
3. numbers
4. special\_symbols

#### Example with parameter

[](#example-with-parameter)

```
use TBETool\PasswordGenerator;

$passwordGenerator = new PasswordGenerator(16, 5, 'lower_case,numbers,special_symbols');

```

#### Set Parameters after creating object

[](#set-parameters-after-creating-object)

Parameters set during object creation will be overwritten.

```
# Set lenght of password to 16
# params: (int) length
$passwordGenerator->setLength(16);

# Set number of passwords to generate
# params: (int) count
$passwordGenerator->setCount(5);

# Set characters to use in password
# params: (string) characters
$passwordGenerator->setCharacters('lower_case,numbers');

```

### Generate Password

[](#generate-password)

This will return single password from all passwords generated

```
@return string of password
$password = $passwordGenerator->generate();

```

### Get All Generated Passwords

[](#get-all-generated-passwords)

```
@return array of passwords
$passwords = $passwordGenerator->getPasswords();

```

### Get new password from generated passwords

[](#get-new-password-from-generated-passwords)

```
@return string of new password
$password = $passwordGenerator->getPassword();

```

### Get last accessed password

[](#get-last-accessed-password)

```
@return string of last password retrieved
$password = $passwordGenerator->getLastPassword();

```

Developer
=========

[](#developer)

Anuj Sharma ()

Package
=======

[](#package)

TBE ()

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

5

Last Release

3118d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6560085?v=4)[Anuj Sharma](/maintainers/anuj9196)[@anuj9196](https://github.com/anuj9196)

---

Top Contributors

[![anuj9196](https://avatars.githubusercontent.com/u/6560085?v=4)](https://github.com/anuj9196 "anuj9196 (11 commits)")

---

Tags

password generatorphp password generatorsecure password generatorphp password generator class

### Embed Badge

![Health badge](/badges/tbetool-php-password-generator/health.svg)

```
[![Health](https://phpackages.com/badges/tbetool-php-password-generator/health.svg)](https://phpackages.com/packages/tbetool-php-password-generator)
```

###  Alternatives

[ph-7/passcode-password-generator

A simple way to generate random cryptographically secure passcodes and passwords

1223.4k2](/packages/ph-7-passcode-password-generator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
