protected function shared_secret($hash)
    {
        $length = 20;
        if($hash == 'sha256') {
            $length = 256;
        }
        
        $secret = '';
        for($i = 0; $i < $length; $i++) {
            $secret .= mt_rand(0,255);
        }
        
        return $secret;
    }
protected function shared_secret($hash)
    {
        $length = 20;
        if($hash == 'sha256') {
            $length = 256;
        }
        
        $secret = '';
        for($i = 0; $i < $length; $i++) {
            $secret .= mt_rand(0,255);
        }
        
        return $secret;
    }
protected function shared_secret ( $ hash ) { $ length = 20 ; if ( $ hash == 'sha256' ) { $ length = 256 ; } $ secret = '' ; for ( $ i = 0 ; $ i < $ length ; $ i ++ ) { $ secret .= mt_rand ( 0 , 255 ) ; } return $ secret ; }
Generates a random shared secret.
@return string
Generates a random shared secret .