public function Sign(&$Request, $Modify = FALSE) {

      // Fail if no ID is present
      $VanillaID = GetValue('VanillaID', $Request, FALSE);
      if (empty($VanillaID))
         return FALSE;
      
      if ($VanillaID != Gdn::InstallationID()) return FALSE;

      // We're going to work on a copy for now
      $SignatureArray = $Request;

      // Build the request time
      $RequestTime = Gdn_Statistics::Time();
      // Get the secret key
      $RequestSecret = Gdn::InstallationSecret();

      // Remove the hash from the request data before checking or building the signature
      unset($SignatureArray['SecurityHash']);

      // Add the real secret and request time
      $SignatureArray['Secret'] = $RequestSecret;
      $SignatureArray['RequestTime'] = $RequestTime;

      $SignData = array_intersect_key($SignatureArray, array_fill_keys(array(
         'VanillaID',
         'Secret',
         'RequestTime',
         'TimeSlot'
      ), NULL));

      // ksort the array to preserve a known order
      $SignData = array_change_key_case($SignData, CASE_LOWER);
      ksort($SignData);

      // Calculate the hash
      $RealHash = sha1(http_build_query($SignData));

      if ($Modify) {
         $Request['RequestTime'] = $RequestTime;
         $Request['SecurityHash'] = $RealHash;
         ksort($Request);
      }

      return $RealHash;
   }