/yii-hashids

Extension for the hashids library

Primary LanguagePHPMIT LicenseMIT

yii-hashids

YII Extension for the Hashids library

Put the yii-hashids folder into the extensions folder.

Configuration

'components' => array(
  ...
  'hashids' => array(
    'class' => 'application.extensions.yii-hashids.CHashIDs',
  ),
  ...
)

Usage

// get hashid from numerical ID
Yii::app()->hashids->encrypt(<id>)

// get back the ID from the hashid
Yii::app()->hashids->decrypt(<hashid>)