code: function signSubscription () {
      var to_sign = args.sid + ':' + args.channel + '.' + args.resource +
                    ':ttl=' + args.ttl + ':read=' + args.read +
                    ':write=' + args.write
  
      if (self.bbt.userinfo.userid) {
        to_sign = to_sign + ':userid=' + self.bbt.userinfo.userid
      }
  
      var signature = crypto.createHmac('sha1', self.bbt.transport.secretKey)
      .update(to_sign)
      .digest('base64')
  
      var auth = {
        auth: self.bbt.transport.key + ':' + signature
      }
  
      if (self.bbt.userinfo.userid) {
        auth.userid = self.bbt.userinfo.userid
      }
  
      return auth
    }
docs: /* Utility function for signing connection
  Will be used with function based authentication method
  (self sufficient authentication - requires Secret Key)