PHPackages                             yuloh/battery-staple - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. yuloh/battery-staple

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

yuloh/battery-staple
====================

Generate XKCD inspired passwords

1.0(9y ago)458131MITPHP

Since Nov 13Pushed 9y agoCompare

[ Source](https://github.com/matt-allan/battery-staple)[ Packagist](https://packagist.org/packages/yuloh/battery-staple)[ RSS](/packages/yuloh-battery-staple/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

Battery Staple
==============

[](#battery-staple)

A password generator, inspired by XKCD.

[![XKCD comic](https://camo.githubusercontent.com/f6697f2639515d1582b2724617468cfc6b1772888503ff2d21619f053d1e4435/687474703a2f2f696d67732e786b63642e636f6d2f636f6d6963732f70617373776f72645f737472656e6774682e706e67)](https://camo.githubusercontent.com/f6697f2639515d1582b2724617468cfc6b1772888503ff2d21619f053d1e4435/687474703a2f2f696d67732e786b63642e636f6d2f636f6d6963732f70617373776f72645f737472656e6774682e706e67)

Install
-------

[](#install)

### Via Composer

[](#via-composer)

```
composer require yuloh/battery-staple
```

Usage
-----

[](#usage)

```
$password = Yuloh\BatteryStaple\PasswordGenerator::generate();
// returns something like "beefjapanesesealedunwrap"
```

Security
--------

[](#security)

The library is 8 lines of code, so there isn't much that can go wrong. Here is what happens:

- A word list of 10,000 words is loaded.
- A random number is generated with `random_int` and the word on that line is used.
- Repeat the above until you have 4 words.

That being said, I am not a security expert. I cannot guarantee that this library is cryptographically secure and you shouldn't use it for anything important.

Contributing
------------

[](#contributing)

Contributions Welcome. Some ideas:

- Allow choosing a delimiter
- Set min/max word length, so you don't get words like 'the'
- Case transformation options (using [neko](https://github.com/yuloh/neko)?)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

3516d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9440455?v=4)[Matt A](/maintainers/matt-allan)[@matt-allan](https://github.com/matt-allan)

---

Top Contributors

[![geekish](https://avatars.githubusercontent.com/u/684339?v=4)](https://github.com/geekish "geekish (1 commits)")

### Embed Badge

![Health badge](/badges/yuloh-battery-staple/health.svg)

```
[![Health](https://phpackages.com/badges/yuloh-battery-staple/health.svg)](https://phpackages.com/packages/yuloh-battery-staple)
```

###  Alternatives

[hidehalo/nanoid-php

A copy of nanoid in PHP

8124.5M52](/packages/hidehalo-nanoid-php)[oat-sa/tao-core

TAO core extension

66140.1k108](/packages/oat-sa-tao-core)[paragonie/random-lib

A Library For Generating Secure Random Numbers

703.5M26](/packages/paragonie-random-lib)[jasonhinkle/php-gpg

GPG / PGP port written in pure PHP with no binary dependencies

116149.2k1](/packages/jasonhinkle-php-gpg)[gpslab/base64uid

Generate UID like YouTube

68106.9k](/packages/gpslab-base64uid)[wyrihaximus/react-child-process-messenger

Messenger decorator for react/child-process

32283.3k4](/packages/wyrihaximus-react-child-process-messenger)

PHPackages © 2026

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