diff --git a/core/core.console.services.yml b/core/core.console.services.yml
index 6f70991..0641fe1 100644
--- a/core/core.console.services.yml
+++ b/core/core.console.services.yml
@@ -20,3 +20,9 @@ services:
     arguments: ['@console.bootstrap']
     tags:
       - { name: console.command }
+
+  console.command.rebuild_token_calculator:
+      class: Drupal\Core\Console\Command\RebuildTokenCalculator
+      arguments: ['@console.bootstrap']
+      tags:
+        - { name: console.command }
diff --git a/core/lib/Drupal/Core/Console/Command/RebuildTokenCalculator.php b/core/lib/Drupal/Core/Console/Command/RebuildTokenCalculator.php
new file mode 100644
index 0000000..f09532f
--- /dev/null
+++ b/core/lib/Drupal/Core/Console/Command/RebuildTokenCalculator.php
@@ -0,0 +1,69 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Console\Command\RebuildTokenCalculator.
+ */
+
+namespace Drupal\Core\Console\Command;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Drupal\Component\Utility\Crypt;
+use Drupal\Core\Site\Settings;
+
+/**
+ * Generates a token to use with rebuild.php
+ */
+class RebuildTokenCalculator extends CommandBootstrapBase {
+
+  /**
+   * Timestamp used for token calculation.
+   *
+   * @var int
+   */
+  protected $timestamp;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function configure() {
+    parent::configure();
+    $this
+      ->setName('drupal:rebuild-token-calculator')
+      ->setDescription('Generates a token to use with rebuild.php.');
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function execute(InputInterface $input, OutputInterface $output) {
+    $kernel = $this->bootstrap->bootstrap($this, $input, $output);
+    if ($kernel) {
+      $timestamp = $this->getTimestamp();
+      $token = Crypt::hmacBase64($timestamp, Settings::get('hash_salt'));
+      $output->writeln("timestamp=$timestamp&token=$token\n");
+    }
+  }
+
+  /**
+   * Gets the current timestamp.
+   *
+   * @return int
+   *   The timestamp used to generate the token.
+   */
+  protected function getTimestamp() {
+    return $this->timestamp;
+  }
+
+  /**
+   * Sets the timestamp used for calculating the token.
+   *
+   * @param int $timestamp
+   *   Timestamp to use to calculate the token.
+   */
+  public function setTimestamp($timestamp) {
+    $this->timestamp = $timestamp;
+  }
+
+}
diff --git a/core/tests/Drupal/Tests/Core/Console/Command/RebuildTokenCalculatorTest.php b/core/tests/Drupal/Tests/Core/Console/Command/RebuildTokenCalculatorTest.php
new file mode 100644
index 0000000..7e923a1
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/Console/Command/RebuildTokenCalculatorTest.php
@@ -0,0 +1,86 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Core\Console\Command\RebuildTokenCalculatorTest.
+ */
+
+namespace Drupal\Tests\Core\Console\Command;
+
+use Drupal\Component\Utility\Crypt;
+use Drupal\Core\Console\Command\RebuildTokenCalculator;
+use Drupal\Core\Site\Settings;
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * @coversDefaultClass \Drupal\Core\Console\Command\RebuildTokenCalculator
+ */
+class RebuildTokenCalculatorTest extends UnitTestCase {
+
+  /**
+   * The bootstrap service.
+   *
+   * @var \Drupal\Core\Console\BootstrapInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $bootstrap;
+
+  /**
+   * The command under test.
+   *
+   * @var \Drupal\Core\Console\Command\RebuildTokenCalculator
+   */
+  protected $command;
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getInfo() {
+    return array(
+      'description' => '',
+      'name' => '\Drupal\Core\Console\RebuildTokenCalculator unit test',
+      'group' => 'Console',
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   *
+   * @covers ::__construct
+   * @covers ::configure
+   */
+  public function setUp() {
+    $this->bootstrap = $this->getMock('\Drupal\Core\Console\BootstrapInterface');
+
+    $this->command = new RebuildTokenCalculator($this->bootstrap);
+  }
+
+  /**
+   * @covers ::execute
+   */
+  public function testExecute() {
+    $time = time();
+    $this->command->setTimestamp($time);
+    $salt = $this->randomName();
+    $token = Crypt::hmacBase64($time, $salt);
+    new Settings(array('hash_salt' => $salt));
+
+    $input = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
+
+    $output = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+    $output->expects($this->atLeastOnce())
+      ->method('writeln')
+      ->with("timestamp=$time&token=$token\n");
+
+    $kernel = $this->getMock('\Drupal\Core\DrupalKernelInterface');
+
+    $this->bootstrap->expects($this->once())
+      ->method('bootstrap')
+      ->with($this->command, $input, $output)
+      ->will($this->returnValue($kernel));
+
+    $method = new \ReflectionMethod($this->command, 'execute');
+    $method->setAccessible(TRUE);
+    $method->invoke($this->command, $input, $output);
+  }
+
+}
