original_string: protected function generate_data_key() {
          global $DB;
  
          $key = new \stdClass();
          $key->handler = $this->handler->id;
          $key->datavalue = $this->datavalue;
          $key->datakey = md5($this->datavalue . '_' . time() . random_string(40));
          $key->timecreated = time();
  
          if ($this->handler->defaultexpiration) {
              // Apply the default expiration time to the datakey.
              $key->expires = $key->timecreated + $this->handler->defaultexpiration;
          }
          $DB->insert_record('messageinbound_datakeys', $key);
  
          return $key->datakey;
      }
code: protected function generate_data_key() {
          global $DB;
  
          $key = new \stdClass();
          $key->handler = $this->handler->id;
          $key->datavalue = $this->datavalue;
          $key->datakey = md5($this->datavalue . '_' . time() . random_string(40));
          $key->timecreated = time();
  
          if ($this->handler->defaultexpiration) {
              // Apply the default expiration time to the datakey.
              $key->expires = $key->timecreated + $this->handler->defaultexpiration;
          }
          $DB->insert_record('messageinbound_datakeys', $key);
  
          return $key->datakey;
      }
code_tokens: protected function generate_data_key ( ) { global $ DB ; $ key = new \ stdClass ( ) ; $ key -> handler = $ this -> handler -> id ; $ key -> datavalue = $ this -> datavalue ; $ key -> datakey = md5 ( $ this -> datavalue . '_' . time ( ) . random_string ( 40 ) ) ; $ key -> timecreated = time ( ) ; if ( $ this -> handler -> defaultexpiration ) { // Apply the default expiration time to the datakey. $ key -> expires = $ key -> timecreated + $ this -> handler -> defaultexpiration ; } $ DB -> insert_record ( 'messageinbound_datakeys' , $ key ) ; return $ key -> datakey ; }
docstring: Generate a new secret key for the current data item and handler combination.
  
  @return string The new generated secret key for this data item.
docstring_tokens: Generate a new secret key for the current data item and handler combination .