Download the PHP package darkv/php-password-generator without Composer

On this page you can find all versions of the php package darkv/php-password-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-password-generator

php-password-generator

The PHP class PasswordGenerator serves as a password generator to create memorable passwords like the keychain of macOS ≤ 10.14 did.

Getting Started

Add via composer

Use composer to install the generator into your project:

Direct Import

Copy the file PasswordGenerator.php into your project and include it in your own PHP file(s) with include 'PasswordGenerator.php';. Then create an instance either by using the predefined static methods for specific languages or customize it yourself by using the standard constructor.

Prerequisites

This class works with PHP >= 7.4 and needs a working internet connection.

Password Syntax

The syntax of generated passwords can be defined by a pattern. That pattern consists of control characters that define the construction of the password string. The available control characters are:

If you don't provide your own pattern the default pattern wisw is used. Some examples of generated passwords with that default pattern are:

Word Lists

The class uses RSS feeds to build a word list from which random words are used for password generation. The class has some predefined configurations for the languages English and German but can be customized too:

The params minLength and maxLength denote the allowed lengths of the words from the URL source to get into the word list. If a word list has been successfully built, that list is saved into the file wordlist.json. The next time you create an instance of PasswordGenerator and the URL source cannot be contacted or does not contain any usable words that cached list is loaded instead. If you reuse the very same instance the word list is also reused so no further HTTP requests are generated.

Optionally you can specify wordCacheFile to control the location and name of the cached wordlist.

To a custom instance you can pass an optional boolean parameter fetch. When false, the cached wordlist will be preferred but falls back to fetching if it could not be loaded.

When fetching an RSS source the normal behaviour is to create a new list, overwriting an existing cache file. You can opt-in to merge the new wordlist with an exisiting cache file instead, by setting the appendWordlist parameter to true. On the one hand this will result in bigger word lists, increasing entropy, on the other hand this may lead to very long lists. You can limit the number of items in the wordlist with the limitWordlist configuration parameter. When using this option and the wordlist is exceeding that limit, it is shuffled and then sliced to that number.

Caching

If you need to use that class in contexts where you do not have an internet connection you can prebuild a word list and copy the generated wordlist.json file into your project. When using the PasswordGenerator you can tell it to only use that cached list and skip the URL source request:

Location of the cache file can be passed as parameter to CACHED, by default wordlist.json in work dir will be used.

URL Sources

As a source for word lists, this class uses a configurable RSS feed. The feed has to be in XML format and contain description tags from which the textual content is extracted.

HTTP Redirects

If, for security reasons, you want to prevent PasswordGenerator to follow redirects when fetching the given URL, you can set the parameter httpRedirects to 0. The default is 2 which follows a maximum of two redirects.

Example:

Parameters

When creating an instance of PasswordGenerator you can provide the following parameters:

License

This project is licensed under the MIT License - see the LICENSE.md file for details.


All versions of php-password-generator with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-curl Version *
ext-dom Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package darkv/php-password-generator contains the following files

Loading the files please wait ....