Download the PHP package wllcdev/arda-tokens without Composer

On this page you can find all versions of the php package wllcdev/arda-tokens. 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 arda-tokens

Arda Tokens

CI Latest Version on Packagist PHP Version License

"Not all who wander are lost" - but all who need tokens shall find them here.

Generate memorable, human-readable token names inspired by Tolkien's Legendarium. Perfect for friendly resource identifiers, human-readable labels, memorable names for non-security-critical purposes, or any scenario where you need unique names that are easy to read and remember.

Why Arda Tokens?

Requirements

Installation

Quick Start

That's it! No configuration needed.

Usage

Generating Tokens

Checking Capacity

Calculate how many unique tokens can be generated:

Token Format

Tokens follow the pattern: {adjective}-{noun}[-{hex}]

Suffix Length Example Unique Combinations
0 (default) precious-ring 12,600
1 elvish-frodo-a 201,600
2 mithril-gandalf-3f 3,225,600
3 hobbitish-shire-a2b 51,609,600
4 (max) ancient-mordor-f3a1 825,753,600

Security Considerations

This package generates human-readable token names and is designed for:

This package is NOT suitable for:

Why?

The maximum entropy provided is ~30 bits (with 4-char suffix), which is below the OWASP-recommended minimum of 64 bits for security-sensitive applications.

Suffix Length Unique Combinations Entropy (bits)
0 (default) 12,600 ~13.6
1 201,600 ~17.6
2 3,225,600 ~21.6
3 51,609,600 ~25.6
4 (max) 825,753,600 ~29.6

What Makes It Secure for Its Purpose?

API Reference

Arda::generate(int $suffixLength = 0): string

Generates a random token name.

Parameter Type Default Description
$suffixLength int 0 Length of hex suffix (0-4).

Returns: string - The generated token name.

Throws:

Arda::token(int $suffixLength = 0): string

Alias of generate().

Arda::capacity(): int

Returns the total number of unique combinations without a hex suffix.

Returns: int - Number of unique adjective-noun combinations (12,600).

Arda::capacityWithSuffix(int $suffixLength = 3): int

Returns the total number of unique combinations with a hex suffix.

Parameter Type Default Description
$suffixLength int 3 Length of hex suffix (0-4).

Returns: int - Total unique combinations. Returns same as capacity() when $suffixLength is 0.

Throws: InvalidArgumentException if $suffixLength is not between 0 and 4.

Word Lists

The generator includes 90 adjectives and 140 nouns from Tolkien's Legendarium:

Adjectives: precious, elvish, mithril, hobbitish, dwarven, entish, rohirric, gondorian, starlit, moonlit, shadowy, ancient, forgotten, blessed, cursed, hidden, wandering, faithful, valiant...

Nouns:

Development

This project uses DevContainers for development.

Getting Started

  1. Clone the repository
  2. Open in VS Code (or any DevContainer-compatible editor)
  3. Reopen in Container when prompted
  4. Dependencies will be installed automatically

Commands

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

The MIT License (MIT). Please see License File for more information.


All versions of arda-tokens with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
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 wllcdev/arda-tokens contains the following files

Loading the files please wait ...