src/Model/Comment/SecurityToken.php
protected function generate($length = null)
    {
        $generator = new RandomGenerator();
        $result = $generator->randomToken('sha256');
        if ($length !== null) {
            return substr($result, 0, $length);
        }
        return $result;
    }
protected function generate($length = null)
    {
        $generator = new RandomGenerator();
        $result = $generator->randomToken('sha256');
        if ($length !== null) {
            return substr($result, 0, $length);
        }
        return $result;
    }
protected function generate ( $ length = null ) { $ generator = new RandomGenerator ( ) ; $ result = $ generator -> randomToken ( 'sha256' ) ; if ( $ length !== null ) { return substr ( $ result , 0 , $ length ) ; } return $ result ; }
Generates new random key

@param integer $length

@return string
Generates new random key