PHPackages                             xavierfaucon/bravoids - 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. xavierfaucon/bravoids

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xavierfaucon/bravoids
=====================

Converts Ids (base10) to Hashids (base50 or 62)

0.1.0(11y ago)335MITPHPPHP &gt;=5.4.0

Since Feb 2Pushed 11y ago1 watchersCompare

[ Source](https://github.com/xavierfaucon/BravoIds)[ Packagist](https://packagist.org/packages/xavierfaucon/bravoids)[ Docs](https://github.com/xavierfaucon/BravoIds)[ RSS](/packages/xavierfaucon-bravoids/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

BravoIDs [![Build Status](https://camo.githubusercontent.com/c8c2bf76b1914982b4779fdc563c277639995986eebd8db188a0254ef9256ebc/68747470733a2f2f7472617669732d63692e6f72672f786176696572666175636f6e2f427261766f4964732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/xavierfaucon/BravoIds)
=======================================================================================================================================================================================================================================================================================================

[](#bravoids-)

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

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

### BravoIDs::encrypt

[](#bravoidsencrypt)

### Description

[](#description)

```

```

### BravoIDs::encrypt

[](#bravoidsencrypt-1)

### Description

[](#description-1)

```

```

Returns an ID from a hash.

#### Parameters:

[](#parameters)

- $hash : The hash you want to convert into an ID
- $passPhrase : A passphrase that you must provide
- $minHashLength (optional - default is 0) : Specify the minimum length for the output.
- $safeCharacters (optional - default is true) : Remove all the vowels to generate the output to avoid curse words

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:

[](#basic-usage)

To simply generate IDS :

```
