lithium\security\Password::_generateSaltXdes PHP Method

_generateSaltXdes() protected static method

Generates an Extended DES salt for use in lithium\security\Password::hash().
protected static _generateSaltXdes ( integer $count = null ) : string
$count integer The base-2 logarithm of the iteration count. Defaults to `18`. Can be `1` to `24`. 1 will be stripped from the non-log value, e.g. 2^18 - 1, to ensure we don't use a weak DES key.
return string The XDES salt.
    protected static function _generateSaltXdes($count = null)
    {
        $count = (int) $count;
        $count = $count < 1 || $count > 24 ? static::XDES : $count;
        $count = (1 << $count) - 1;
        $base64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
        $output = '_' . $base64[$count & 0x3f] . $base64[$count >> 6 & 0x3f];
        $output .= $base64[$count >> 12 & 0x3f] . $base64[$count >> 18 & 0x3f];
        $output .= String::random(3, array('encode' => String::ENCODE_BASE_64));
        return $output;
    }