redpanda / hashids-service-provider
Hashids for Silex
dev-master / 1.x-dev
2014-05-11 09:49 UTC
Requires
- hashids/hashids: dev-master
- silex/silex: ~1.0
Requires (Dev)
- phpunit/phpunit: ~3.7
This package is not auto-updated.
Last update: 2024-10-26 15:49:43 UTC
README
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