Download the PHP package xavierfaucon/bravoids without Composer

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

BravoIDs Build Status

Converts IDs (base10) to Hashed IDs (base50 or 62).

The BravoIDs class offers two methods : BravoIDs::encrypt and BravoIDs::decrypt.

BravoIDs::encrypt

Description

BravoIDs::encrypt

Description

Returns an ID from a hash.

Parameters:

NB : in order to decrypt a hash, you must specify the exact same variables for $passPhrase, $minHashLength and $safeCharacters taht you used for BravoID::encrypt.

Basic Usage:

To simply generate IDS :

Advanced Usage:

To increase hash length :

NB: if you use a 32-bit builds of PHP you won't be able to set a $minHashLengh > 5. This is explained in the Limitations part.

To allow all characters including vowels (cursing words could appear) :

Limitations

Depending on your build of PHP you will be limited:

I did not run tests on 64-bit build of php.

On 32-bit, the limitation means that you'll be able to convert ids up to 2 147 483 647 and not one more.

Moreover, when you use the variable $minHashLength, you reduce the number of available ids.

A computation is done to find the minimum value that your number should have to reach the required HashLength):

For example, to get a hash of at least X characters, you'll need a ~number >= base * (X - 1)~.

Where base is the number of characters used to convert your numbers (base50 with $safeCharacters = true and base62 with $safeCharacters = false).

Once we know what is this minimum value, all your ids are "scaled" to that value, '0' would become 6 250 000 (base50 and $minHashLength = 4).

In this case, this has for effect that your 2 147 483 647 has 6 250 000 less value possible ('0' to '6 249 999').

Thanks

Thanks to ivanakimov and https://github.com/ivanakimov/hashids.php from which I borrowed the _consistent_shuffle method.

Thanks to Kevin van Zonneveld who wrote this article from which I took the idea of removing the vowels to get safe Words: http://kvz.io/blog/2009/06/10/create-short-ids-with-php-like-youtube-or-tinyurl/

BravoID is named after the function offered on this article which was called AlphaID :-)


All versions of bravoids with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
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 xavierfaucon/bravoids contains the following files

Loading the files please wait ....