Download the PHP package seym0n/angry-purple-tiger without Composer
On this page you can find all versions of the php package seym0n/angry-purple-tiger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package angry-purple-tiger
Angry Purple Tiger (PHP)
Generate memorable, human-readable animal-based hash digests for PHP applications.
This is a PHP port of Helium's angry-purple-tiger library, which generates animal-based hash digests meant to be memorable and human-readable. Perfect for anthropomorphizing project names, crypto addresses, UUIDs, and other complex strings in user interfaces.
Installation
Install via Composer:
Usage
Basic Example
Custom Separator
Different Styles
API
animalHash($input, $style = 'titlecase', $separator = ' ')
Generates an animal-based hash from the input string.
Parameters:
$input(string, required): The string to hash$style(string, optional): Output style -'titlecase','lowercase', or'uppercase'. Default:'titlecase'$separator(string, optional): Character(s) to separate words. Default:' '(space)
Returns:
- (string): A three-word animal-based hash in the format:
adjective color animal
Throws:
\Exception: If an unknown style is provided
How It Works
The library:
- Generates an MD5 hash of the input string
- Converts the hash into bytes
- Compresses the bytes into 3 values using XOR operations
- Uses these values as indices to select words from three lists:
- 256 adjectives
- 256 colors
- 256 animals
- Formats and returns the three words according to the specified style and separator
Testing
Run the test suite with PHPUnit:
License
Apache 2.0
Original library © 2018 Helium Systems, Inc. PHP port by Simon
Credits
This is a PHP port of the original JavaScript library angry-purple-tiger by Helium Systems, Inc.
All versions of angry-purple-tiger with dependencies
ext-hash Version *