diff --git a/search_api_saved_searches.search_entity.inc b/search_api_saved_searches.search_entity.inc
index 7d3f9e9..a679472 100644
--- a/search_api_saved_searches.search_entity.inc
+++ b/search_api_saved_searches.search_entity.inc
@@ -113,7 +113,7 @@ class SearchApiSavedSearch extends Entity {
    */
   public function save() {
     if (!$this->enabled && empty($this->options['key'])) {
-      $this->options['key'] = base64_encode(drupal_random_bytes(12));
+      $this->options['key'] = drupal_hash_base64(drupal_random_bytes(12));
     }
     if ($this->enabled && !isset($this->results)) {
       $results = array();
