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)558131MITPHP

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 6d 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 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

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

3561d 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

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k476.2M1.7k](/packages/phpseclib-phpseclib)[oat-sa/tao-core

TAO core extension

64147.9k151](/packages/oat-sa-tao-core)[hidehalo/nanoid-php

A copy of nanoid in PHP

8145.0M63](/packages/hidehalo-nanoid-php)[paragonie/random-lib

A Library For Generating Secure Random Numbers

743.7M28](/packages/paragonie-random-lib)[jasonhinkle/php-gpg

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

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

Generate UID like YouTube

68111.1k](/packages/gpslab-base64uid)

PHPackages © 2026

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