redpanda/hashids-service-provider

dev-master / 1.x-dev 2014-05-11 09:49 UTC

README

Build Status

Usage

use Redpanda\Silex\Provider\HashidsServiceProvider;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;

$app = new Application();

$app->register(new HashidsServiceProvider(), array(
    'hashids.options' => array(
        'post' => array(
            'salt' => 'mySalt',
            'min_hash_length' => 5,
            'alphabet' => ''
        )
    )
));

// encrypt
$hash = $app['hashids']['post']->encrypt(1,2,3);

// decrypt
$numbers = $app['hashids']['post']->decrypt($hash);

##License

MIT License